如何使用 apt 解决未满足的依赖项错误

如何使用 apt 解决未满足的依赖项错误

每当我尝试安装某些东西时apt都会出现以下错误。

○ → sudo apt install mysql-server
[sudo] password for galaxy: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 emacs27 : Depends: emacs27-common but it is not going to be installed
 mysql-server : Depends: mysql-server-8.0 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

当我运行该命令时,sudo apt --fix-broken install它出现此错误。

dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/emacs27-common_27.1~1.git86d8d76aa3-kk2+20.04_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我也尝试过sudo apt-get -f install,但是这也不起作用。

dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/emacs27-common_27.1~1.git86d8d76aa3-kk2+20.04_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

请帮我解决这个问题。

我正在使用 Kubuntu 20.04 LTS

有人告诉我运行这个并将输出放在这里 apt-cache policy emacs27 emacs27-common

emacs27:
  Installed: 27.1~1.git86d8d76aa3-kk2+20.04
  Candidate: 27.1~1.git86d8d76aa3-kk2+20.04
  Version table:
 *** 27.1~1.git86d8d76aa3-kk2+20.04 500
        500 http://ppa.launchpad.net/kelleyk/emacs/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status
emacs27-common:
  Installed: (none)
  Candidate: 27.1~1.git86d8d76aa3-kk2+20.04
  Version table:
     27.1~1.git86d8d76aa3-kk2+20.04 500
        500 http://ppa.launchpad.net/kelleyk/emacs/ubuntu focal/main amd64 Packages
        500 http://ppa.launchpad.net/kelleyk/emacs/ubuntu focal/main i386 Packages

答案1

如果你不使用 Emacs27,你可以通过以下方式清除其 PPA

sudo apt-get install ppa-purge
sudo ppa-purge ppa:kelleyk/emacs

然后安装升级和中断的软件包

sudo apt-get -f install
sudo apt-get upgrade

相关内容