我在从 16.04 升级到 18.04 时出现此错误,中途断电。
错误看起来是这样的,apt-get install -f 无法修复它。
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
apt : Depends: libgcc-s1 (>= 3.0) but it is not installed
Depends: libgnutls30 (>= 3.6.12) but 3.5.18-1ubuntu1.3 is installed
Depends: libseccomp2 (>= 2.4.2) but 2.4.1-0ubuntu0.18.04.2 is installed
apt-utils : Depends: apt (= 1.6.12) but 2.0.2 is installed
libapt-pkg6.0 : Depends: libgcc-s1 (>= 3.0) but it is not installed
libatomic1 : Depends: gcc-8-base (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
libcc1-0 : Depends: gcc-8-base (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
libgcc1 : Depends: gcc-8-base (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
libgcc1:i386 : Depends: gcc-8-base:i386 (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
libgomp1 : Depends: gcc-8-base (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
libitm1 : Depends: gcc-8-base (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
liblsan0 : Depends: gcc-8-base (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
libmpx2 : Depends: gcc-8-base (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
libquadmath0 : Depends: gcc-8-base (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
libstdc++6 : Depends: gcc-10-base (= 10-20200411-0ubuntu1) but 10-20200425-1ubuntu2 is installed
Depends: libgcc-s1 (>= 4.2) but it is not installed
libstdc++6:i386 : Depends: gcc-10-base:i386 (= 10-20200411-0ubuntu1) but it is not installed
Depends: libgcc-s1:i386 (>= 4.2) but it is not installed
libtsan0 : Depends: gcc-8-base (= 8.3.0-6ubuntu1~18.04.1) but 8.4.0-1ubuntu1~18.04 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
另外 $grep -r ^deb /etc/apt/ --include="*.list"
/etc/apt/sources.list.d/google-chrome.list:deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
/etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-bionic.list:deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic main
/etc/apt/sources.list.d/teamviewer.list:deb http://linux.teamviewer.com/deb stable main
/etc/apt/sources.list.d/ondrej-ubuntu-php-xenial.list:deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
/etc/apt/sources.list.d/samoilov-lex-ubuntu-aftl-stable-bionic.list:deb http://ppa.launchpad.net/samoilov-lex/aftl-stable/ubuntu bionic main
/etc/apt/sources.list.d/samoilov-lex-ubuntu-aftl-stable-bionic.list:deb-src http://ppa.launchpad.net/samoilov-lex/aftl-stable/ubuntu bionic main
/etc/apt/sources.list.d/skype-stable.list:deb [arch=amd64] https://repo.skype.com/deb stable main
/etc/apt/sources.list:deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted
/etc/apt/sources.list:deb-src http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
/etc/apt/sources.list:deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
/etc/apt/sources.list:deb http://in.archive.ubuntu.com/ubuntu/ bionic universe
/etc/apt/sources.list:deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates universe
/etc/apt/sources.list:deb http://in.archive.ubuntu.com/ubuntu/ bionic multiverse
/etc/apt/sources.list:deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
/etc/apt/sources.list:deb http://in.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu bionic-security main restricted
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu bionic-security universe
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu bionic-security multiverse
/etc/apt/sources.list:deb http://ppa.launchpad.net/samoilov-lex/aftl-stable/ubuntu artful main
/etc/apt/sources.list:deb-src http://ppa.launchpad.net/samoilov-lex/aftl-stable/ubuntu artful main
$ apt-cache 策略 apt apt-utils libgcc1 libatomic1
apt:
Installed: 2.0.2
Candidate: 2.0.2
Version table:
*** 2.0.2 100
100 /var/lib/dpkg/status
1.6.12 500
500 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
1.6.6ubuntu0.1 500
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
1.6.1 500
500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
apt-utils:
Installed: 1.6.12
Candidate: 1.6.12
Version table:
*** 1.6.12 500
500 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
100 /var/lib/dpkg/status
1.6.6ubuntu0.1 500
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
1.6.1 500
500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
libgcc1:
Installed: 1:8.3.0-6ubuntu1~18.04.1
Candidate: 1:10-20200416-0ubuntu1~18.04
Version table:
1:10-20200416-0ubuntu1~18.04 500
500 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main amd64 Packages
1:8.4.0-1ubuntu1~18.04 500
500 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
*** 1:8.3.0-6ubuntu1~18.04.1 100
100 /var/lib/dpkg/status
1:8-20180414-1ubuntu2 500
500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
libatomic1:
Installed: 8.3.0-6ubuntu1~18.04.1
Candidate: 10-20200416-0ubuntu1~18.04
Version table:
10-20200416-0ubuntu1~18.04 500
500 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main amd64 Packages
8.4.0-1ubuntu1~18.04 500
500 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
*** 8.3.0-6ubuntu1~18.04.1 100
100 /var/lib/dpkg/status
8-20180414-1ubuntu2 500
500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages