After upgrading to Eoan, I have some packages that are held back and can not be upgraded. It all seems to come down to cpp
and gcc
:
$ sudo apt install gcc
The following packages have unmet dependencies:
gcc : Depends: cpp (= 4:9.2.1-3.1ubuntu1) but 4:8.3.0-1ubuntu3 is to be installed
Depends: gcc-9 (>= 9.2.1-1~) but it is not going to be installed
$ sudo apt install gcc-9
The following packages have unmet dependencies:
gcc-9 : Depends: cpp-9 (= 9.2.1-9ubuntu2) but it is not going to be installed
Depends: gcc-9-base (= 9.2.1-9ubuntu2) but 9.2.1-17ubuntu1~18.04.1 is to be installed
$ sudo apt install gcc-9-base
gcc-9-base is already the newest version (9.2.1-17ubuntu1~18.04.1).
I don't understand nearly enough to interpret in, but here's the output of apt-cache
:
$apt-cache policy cpp
cpp:
Installed: 4:8.3.0-1ubuntu3
Candidate: 4:9.2.1-3.1ubuntu1
Version table:
4:9.2.1-3.1ubuntu1 500
500 http://archive.ubuntu.com/ubuntu eoan/main amd64 Packages
*** 4:8.3.0-1ubuntu3 100
100 /var/lib/dpkg/status
$apt-cache policy cpp-9
cpp-9:
Installed: (none)
Candidate: 9.2.1-9ubuntu2
Version table:
9.2.1-9ubuntu2 500
500 http://archive.ubuntu.com/ubuntu eoan/main amd64 Packages
Can someone help me make sense of what might be going on here? I have disabled all repositories except the default ones, with no success. I've also tried manually installing the version of gcc-9 that seems to come with 19.10 (9.2.1-9ubuntu2
), but that only adds insult to injury, as everything else wants 9.2.1-17ubuntu1~18.04.1
The root problem here was that some packages were installed with a newer version than available in repositories, and becuase a lot of them had critical dependencies, I couldn't just purge and reinstall them.
The solution: To upgrade them all in one monster expression like this
sudo apt install lib32gcc1=1:9.2.1-9ubuntu2 lib32stdc++6=9.2.1-9ubuntu2 libasan5=9.2.1-9ubuntu2 libatomic1=9.2.1-9ubuntu2 libcc1-0=9.2.1-9ubuntu2 libgcc1=1:9.2.1-9ubuntu2 libgomp1=9.2.1-9ubuntu2 libitm1=9.2.1-9ubuntu2 liblsan0=9.2.1-9ubuntu2 libstdc++6=9.2.1-9ubuntu2 libtsan0=9.2.1-9ubuntu2 libubsan1=9.2.1-9ubuntu2 libquadmath0=9.2.1-9ubuntu2 ....
and so forth.Before that, I had to use
dpkg -r ...
to remove packages that were involved in this dependency chain, but not at all available through repos. (This involved traversing down their dependency chains step by step.) I usedapt-cache policy
to check availability.