After Upgrading to Ubuntu 18.04 build-essential, g++, gcc & cpp held broken packages
9,081
Solution 1
I've encountered the same - on Ubuntu 16.04 I had the Toolchain Test Builds PPA for gcc and clang builds, including gcc-7
. During the upgrade to 18.04, 3rd party repositories were disabled by the installation process, with this PPA included.
To fix this, try (re?)adding the toolchain PPA to your apt sources list:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
Then, when installing build-essential
, it should successfully pick gcc-7
from the toolchain PPA.
Solution 2
I had the same issue, but apparently I had used a different PPA when I installed those tools.
For me I fixed it with:
sudo add-apt-repository ppa:jonathonf/gcc
Related videos on Youtube
Comments
-
Santhosh Veer over 1 year
After Upgrading to Ubuntu 18.04 from 16.04 build-essential, g++, gcc & cpp
E: Unable to correct problems, you have held broken packages.
$ sudo apt-get install build-essential Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: build-essential : Depends: gcc (>= 4:7.2) but it is not going to be installed Depends: g++ (>= 4:7.2) but it is not going to be installed E: Unable to correct problems, you have held broken packages. $ sudo apt-get install gcc Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: gcc : Depends: gcc-7 (>= 7.3.0-12~) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
The same type of output for g++ & cpp
How to fix this?
-
warsong over 5 yearsI'm getting this same error now (2018/12/10), even though I've removed all 3rd party PPAs.
-
-
void.pointer almost 6 yearsThis didn't work for me, it still says gcc-7 cannot be found.
-
warsong over 5 yearsthis doesn't work for me either, same error as void.pointer
-
Trect over 3 yearsDoes not work for me either. I upgraded from 14.04 to 16.04
-
Trect over 3 yearsThis did not solve the problem. The problem persists