0

I have a new installation of Ubuntu 18.04.1 on a new laptop, and the garbage OS has already botched itself up.

The basic problem is that I cannot apt-get install any package that depends on gcc-7-base or gcc-8-base. For example,

libquadmath0 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.2.0-1ubuntu2~18.04 is installed
libgfortran4 : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.3.0-27ubuntu1~18.04 is installed

According to apt-cache policy, these are the current versions of gcc-7-base or gcc-8-base:

$ apt-cache policy gcc-7-base
gcc-7-base:
  Installed: 7.3.0-27ubuntu1~18.04
  Candidate: 7.3.0-27ubuntu1~18.04
  Version table:
 *** 7.3.0-27ubuntu1~18.04 100
        100 /var/lib/dpkg/status
     7.3.0-16ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
$ apt-cache policy gcc-8-base
gcc-8-base:
  Installed: 8.2.0-1ubuntu2~18.04
  Candidate: 8.2.0-1ubuntu2~18.04
  Version table:
 *** 8.2.0-1ubuntu2~18.04 100
        100 /var/lib/dpkg/status
     8-20180414-1ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

The installed versions have different names than the versions in the repo; the versions in the repo have the name that the other packages seem to expect.

$ apt-cache showpkg gcc-7-base shows that both versions have the exact same "File" origin and MD5 hash:

$ apt-cache showpkg gcc-7-base
Package: gcc-7-base
Versions: 
7.3.0-27ubuntu1~18.04 (/var/lib/dpkg/status)
 Description Language: 
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages
                  MD5: b6e93638a6d08ea7a18929d7cf078e5d
...
7.3.0-16ubuntu3 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages)
 Description Language: 
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages
                  MD5: b6e93638a6d08ea7a18929d7cf078e5d

(with a similar result for gcc-8-base, I'll post it if anyone asks). So as far as I can tell the 'bad' (installed) packages are the exact same packages as the 'good' (expected) packages, and from the same source, but for some reason they have different names, and that's preventing things like libquadmath0 and libgfortran4 from installing.

A web search for "7.3.0-27ubuntu1~18.04" gives this description page for the bionic-updates repo as the only relevant hit, but the only "updates" repos in my /etc/apt/sources.list are commented out, and I've never knowingly had them enabled.

So, my first question is 1) How did the packages 7.3.0-27ubuntu1~18.04 and 8.2.0-1ubuntu2~18.04 get installed on my computer? Is there any way of knowing this?

My second question is 2) How do I fix it using apt-get? Since the highest-priority versions of each in the output of apt-cache policy are the "correct" versions, would

$ apt-get remove gcc-7-base
$ apt-get install gcc-7-base

produce the correct configuration of having 7.3.0-16ubuntu3 and 8-20180414-1ubuntu2 installed for the packages gcc-7-base and gcc-8-base, respectively?

For the record, I've tried an update/upgrade/autoremove cycle, I've tried apt-get install -f, and I've tried apt-get clean. None of these had any effect whatsoever.

1 Answers1

0

Answer to question 1: versions you're asking about seem to be the default package versions for 18.04 (this is my output): jan@jan-XPS-9550:~$ sudo apt-get install libquadmath0 libgfortran4 Reading package lists... Done Building dependency tree
Reading state information... Done libgfortran4 is already the newest version (7.3.0-27ubuntu1~18.04). libquadmath0 is already the newest version (8.2.0-1ubuntu2~18.04).

Answer to question 2: I think your best bet would be to: apt-get remove --purge libgfortran4 libquadmath0 gcc-7-base gcc-8-base apt-get autoremove reboot (just in case, most likely not needed at all) install packages again then it should go back to default / non-conflicting ones

Jan Myszkier
  • 1,243