1

On Ubuntu 16.04 I've problems with gcc-5-base package:

user@laptop:~$ sudo apt install libgfortran3
The following packages have unmet dependencies:
 libgfortran3 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.11) but 5.5.0-12ubuntu1~16.04 is to be installed
E: Unable to correct problems, you have held broken packages.

No hold packages: dpkg --get-selection | grep hold returns nothing.

No automatic fixes to apply:

user@laptop:~$ sudo apt -f install
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Reinstall says that everything is ok (but of course is not):

user@laptop:~$ sudo apt install gcc-5-base
gcc-5-base is already the newest version (5.5.0-12ubuntu1~16.04).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

No dependencies to clean:

user@laptop:~$ sudo apt-get --purge autoremove
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded

I think that the problem arose upgrading from 14.04 to 16.04: I've used these commands to fix libstdc++, after do-release-upgrade.

Any other hints?

Thank you.

caneta
  • 121
  • 7

2 Answers2

0

From the problem description, the issue is completely clear.

Your issue is:

libgfortran3 is what you wish to install.
=>=> but it requires gcc-5-base (= 5.4.0-6ubuntu1~16.04.11)
.. .. ..=>=> But gcc-5-base (5.5.0-12ubuntu1~16.04) is available.

See, the problem is, to install libgfortran3 you need (exactly, because of = sign) 5.4.0-6ubuntu1~16.04.11, but this version is not available. What IS available is: 5.5.0-12ubuntu1~16.04, which cannot satisfy the dependency (because the condition is exact match). So nothing is installed.

And since nothing has been, your installation base is also correct, and in correct state. But the package IS broken.

Solution

First download the deb of libgfortran3

 sudo apt download libgfortran3
 sudo dpkg -i --force-depends libgfortran [your version] .deb

The first will download the libgfortan3-version.deb to your pwd.

Next, modify /var/lib/dpkg/status to make dpkg shut up.

 /var/lib/dpkg/status
  • edit /var/lib/dpkg/status
  • Find the package with the broken dependencies
  • edit the Depends: line to stop the package complaining.

Find the line:

Package: libgfortan3

Next edit the line Depends (a few line after the previous one)

Modify:

Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.11)

To:

Depends: gcc-5-base (>= 5.4.0-6ubuntu1~16.04.11)

That should fix it.

0

I solved using sudo apt install gcc-5-base=5.4.0-6ubuntu1~16.04.11. That removed a lot of things, also a critical package to me: xubuntu-desktop.

But reinstalling it with sudo apt install xubuntu-desktop solved other broken dependencies and I was able to do sudo install libgfortran3 with success.

Thanks everyone.

caneta
  • 121
  • 7