安裝fcitx-frontend-qt5出現**E:Unmet dependencies. Try ‘apt-get -f install‘ with no packages**

Tavi_發表於2020-12-18

安裝fcitx-frontend-qt5支援Ubuntu16.04下QT5.9中文輸入

命令:sudo apt-get install fcitx-frontend-qt5
錯誤提示如下:

tavi@Tavi:~$ sudo apt-get install fcitx-frontend-qt5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 fcitx-frontend-qt5 : Depends: fcitx-module-dbus
                      Depends: libfcitx-qt5-1 (>= 1.0.0) but it is not going to be installed
 ubuntu-core-launcher : Depends: snapd (= 2.47.1) but 2.38~14.04 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
tavi@Tavi:~$ apt-get -f install
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

安裝關聯包,也是無果的,會陷入無限的死迴圈當中。

按照錯誤提示,解除關聯安裝
命令:sudo apt-get -f install
但還是出現錯誤

tavi@Tavi:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  cgroup-lite linux-generic-lts-xenial
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  snapd
The following packages will be upgraded:
  snapd
1 upgraded, 0 newly installed, 0 to remove and 68 not upgraded.
25 not fully installed or removed.
Need to get 0 B/20.1 MB of archives.
After this operation, 36.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 256624 files and directories currently installed.)
Preparing to unpack .../snapd_2.47.1_amd64.deb ...
Failed to stop snapd.autoimport.service: Unit snapd.autoimport.service not loaded.
Failed to stop snapd.socket: Unit snapd.socket not loaded.
Failed to stop snapd.service: Unit snapd.service not loaded.
dpkg: warning: subprocess old pre-removal script returned error exit status 5
dpkg: trying script from the new package instead ...
Failed to stop snapd.apparmor.service: Unit snapd.apparmor.service not loaded.
Failed to stop snapd.autoimport.service: Unit snapd.autoimport.service not loaded.
Failed to stop snapd.core-fixup.service: Unit snapd.core-fixup.service not loaded.
Failed to stop snapd.failure.service: Unit snapd.failure.service not loaded.
Failed to stop snapd.recovery-chooser-trigger.service: Unit snapd.recovery-chooser-trigger.service not loaded.
Failed to stop snapd.seeded.service: Unit snapd.seeded.service not loaded.
Failed to stop snapd.service: Unit snapd.service not loaded.
Failed to stop snapd.snap-repair.service: Unit snapd.snap-repair.service not loaded.
Failed to stop snapd.snap-repair.timer: Unit snapd.snap-repair.timer not loaded.
Failed to stop snapd.socket: Unit snapd.socket not loaded.
Failed to stop snapd.system-shutdown.service: Unit snapd.system-shutdown.service not loaded.
dpkg: error processing archive /var/cache/apt/archives/snapd_2.47.1_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 5
Errors were encountered while processing:
 /var/cache/apt/archives/snapd_2.47.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

解決方法如下:

tavi@Tavi:~$ cd /var/lib/dpkg
tavi@Tavi:~$ sudo mv info info.bak			//將舊的info資料夾備份
tavi@Tavi:~$ sudo mkdir info				//新建一個空的info資料夾
tavi@Tavi:~$ sudo apt autoremove snapd		//snaod介紹如下

snapd是新一代跨Linux發行版的軟體包管理技術,支援各大主流Linux發行版,通過Linux核心安全機制保證使用者資料安全,徹底解決包依賴關係相關問題,並大大簡化應用軟體的打包工序。snap同時為安裝及管理snap包的命令列工具。
詳細可參考:https://www.cnblogs.com/kylinos/p/7659882.html

相關文章