apt-get -f install
升级时我收到一条错误消息,要求我修复损坏的软件包。
...
Get:1 http://ppa.launchpad.net/kelleyk/emacs/ubuntu bionic/main amd64 emacs25-common all 25.3~1.gite0284ab-kk1+18.04 [17.5 MB]
Fetched 17.5 MB in 2s (7,805 kB/s)
(Reading database ... 265566 files and directories currently installed.)
Preparing to unpack .../emacs25-common_25.3~1.gite0284ab-kk1+18.04_all.deb ...
Unpacking emacs25-common (25.3~1.gite0284ab-kk1+18.04) ...
dpkg: error processing archive /var/cache/apt/archives/emacs25-common_25.3~1.gite0284ab-kk1+18.04_all.deb (--unpack):
trying to overwrite '/usr/share/emacs/site-lisp/subdirs.el', which is also in package emacs26-common 26.3~1.git96dd019-kk1+18.04
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/emacs25-common_25.3~1.gite0284ab-kk1+18.04_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是sudo apt-cache policy emacs26-common emacs25-common
:
emacs26-common:
Installed: 26.3~1.git96dd019-kk1+18.04
Candidate: 26.3~1.git96dd019-kk1+18.04
Version table:
*** 26.3~1.git96dd019-kk1+18.04 500
500 http://ppa.launchpad.net/kelleyk/emacs/ubuntu bionic/main amd64 Packages
500 http://ppa.launchpad.net/kelleyk/emacs/ubuntu bionic/main i386 Packages
100 /var/lib/dpkg/status
emacs25-common:
Installed: (none)
Candidate: 25.3~1.gite0284ab-kk1+18.04
Version table:
25.3~1.gite0284ab-kk1+18.04 500
500 http://ppa.launchpad.net/kelleyk/emacs/ubuntu bionic/main amd64 Packages
500 http://ppa.launchpad.net/kelleyk/emacs/ubuntu bionic/main i386 Packages
25.2+1-6 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu bionic/main i386 Packages
对于如何解决此问题的任何提示都将不胜感激。
答案1
要暂时解决问题,你可以使用以下方法强制安装软件包
sudo dpkg -i --force-all /var/cache/apt/archives/emacs25-common_25.3~1.gite0284ab-kk1+18.04_all.deb