So I was able to install build-essential
again by following these steps:
$ sudo apt install build-essential
...
The following packages have unmet dependencies:
build-essential : Depends: gcc (>= 4:5.2) but it is not going to be installed
Depends: g++ (>= 4:5.2) but it is not going to be installed
A gcc
version greater 5.2 is required, so lets try to install gcc
.
$ sudo apt install gcc
...
The following packages have unmet dependencies:
gcc : Depends: cpp (>= 4:6.3.0-2ubuntu1) but it is not going to be installed
Depends: gcc-6 (>= 6.3.0-9~) but it is not going to be installed
Okay. Something else is missing. Let’s try installing that.
$ sudo apt install cpp
...
The following packages have unmet dependencies:
cpp : Depends: cpp-6 (>= 6.3.0-9~) but it is not going to be installed
Still nothing. Trying again.
$ sudo apt install cpp-6
...
The following packages have unmet dependencies:
cpp-6 : Depends: gcc-6-base (= 6.3.0-12ubuntu2) but 6.3.0-18ubuntu2~16.04 is to be installed
Once again.
$ sudo apt install gcc-6-base
...
gcc-6-base is already the newest version (6.3.0-18ubuntu2~16.04).
So here I don’t know what exactly went wrong. It should be noted that there is a 16.04
string at the end of that version number. That seemed odd. I removed that package.
$ sudo apt remove gcc-6-base
Now I was able to install build-essential
again. This will also reinstall gcc-6-base
.
$ sudo apt install build-essential
Remaining problem:
$ sudo apt upgrade
...
The following packages have been kept back:
cpp g++ gcc
Root of the problem is similar as above, gcc-7-base
is faulty but I can’t simply remove it, since I get this:
The following packages have unmet dependencies:
libgcc1 : Depends: gcc-7-base (= 7.1.0-5ubuntu2~16.04) but it is not going to be installed
va-driver-all : Depends: mesa-va-drivers but it is not going to be installed or
vdpau-va-driver but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Danger Zone:
I managed to resolve this issue with the following steps:
$ sudo apt install aptitude
$ sudo dpkg --force-all -P gcc-7-base
$ sudo dpkg --force-all -P gcc-7-base:i386
$ sudo aptitude install gcc-7-base
This is super dangerous and might break your installation. Executing dpkg --force-all -P
will remove a package forcefully, ignoring any dependencies on this package. Following this by a regular apt upgrade
might remove almost all relevant software from your installation.
I was only able to recover from there by usind aptitude
which resolved every dependency issue I had.
sudo apt upgrade
and it fixed it. You may not want to upgrade though. – slim May 29 '20 at 19:47