1

I have Ubuntu 18.04.3. Every time I do sudo apt install gcc I get:

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:
 g++ : Depends: g++-7 (>= 7.3.0-12~) but it is not going to be installed
       Depends: gcc-7 (>= 7.3.0-12~) but it is not going to be installed
 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.

I have tried: install -f; it does not upgrade or remove anything. dpkg --get-selections | grep hold does not output anything. sudo aptitude install gcc gave:

The following NEW packages will be installed:
  cpp{a} cpp-7{a} gcc gcc-7{a} gcc-7-base{a} libasan4{a} libatomic1{ab} libc-dev-bin{a} 
  libc6-dev{a} libcilkrts5{a} libgcc-7-dev{a} libisl19{a} libitm1{ab} liblsan0{ab} libmpc3{a} 
  libmpx2{ab} libquadmath0{ab} libtsan0{ab} libubsan0{a} linux-libc-dev{a} manpages-dev{a} 
0 packages upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
Need to get 24.2 MB/24.2 MB of archives. After unpacking 98.5 MB will be used.
The following packages have unmet dependencies:
 libmpx2 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.3.0-6ubuntu1~18.04.1 is installed
 libitm1 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.3.0-6ubuntu1~18.04.1 is installed
 libquadmath0 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.3.0-6ubuntu1~18.04.1 is installed
 libtsan0 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.3.0-6ubuntu1~18.04.1 is installed
 liblsan0 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.3.0-6ubuntu1~18.04.1 is installed
 libatomic1 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.3.0-6ubuntu1~18.04.1 is installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     gcc [Not Installed]                                
2)     gcc-7 [Not Installed]                              
3)     libatomic1 [Not Installed]                         
4)     libgcc-7-dev [Not Installed]                       
5)     libitm1 [Not Installed]                            
6)     liblsan0 [Not Installed]                           
7)     libmpx2 [Not Installed]                            
8)     libquadmath0 [Not Installed]                       
9)     libtsan0 [Not Installed]                           



Accept this solution? [Y/n/q/?] y
The following NEW packages will be installed:
  cpp{a} cpp-7{a} gcc-7-base{a} libisl19{a} libmpc3{a} 
0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 7,354 kB/7,373 kB of archives. After unpacking 25.3 MB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libisl19 amd64 0.19-1 [551 kB]
Get: 2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libmpc3 amd64 1.1.0-1 [40.8 kB]
Get: 3 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 cpp-7 amd64 7.3.0-16ubuntu3 [6,734 kB]
Get: 4 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 cpp amd64 4:7.3.0-3ubuntu2 [27.5 kB]
Fetched 7,354 kB in 1s (6,081 kB/s)
Selecting previously unselected package gcc-7-base:amd64.
(Reading database ... 160059 files and directories currently installed.)
Preparing to unpack .../gcc-7-base_7.3.0-16ubuntu3_amd64.deb ...
Unpacking gcc-7-base:amd64 (7.3.0-16ubuntu3) ...
Selecting previously unselected package libisl19:amd64.
Preparing to unpack .../libisl19_0.19-1_amd64.deb ...
Unpacking libisl19:amd64 (0.19-1) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../libmpc3_1.1.0-1_amd64.deb ...
Unpacking libmpc3:amd64 (1.1.0-1) ...
Selecting previously unselected package cpp-7.
Preparing to unpack .../cpp-7_7.3.0-16ubuntu3_amd64.deb ...
Unpacking cpp-7 (7.3.0-16ubuntu3) ...
Selecting previously unselected package cpp.
Preparing to unpack .../cpp_4%3a7.3.0-3ubuntu2_amd64.deb ...
Unpacking cpp (4:7.3.0-3ubuntu2) ...
Setting up gcc-7-base:amd64 (7.3.0-16ubuntu3) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up libmpc3:amd64 (1.1.0-1) ...
Setting up libisl19:amd64 (0.19-1) ...
Setting up cpp-7 (7.3.0-16ubuntu3) ...
Setting up cpp (4:7.3.0-3ubuntu2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

I checked for gcc -v again and still 'gcc' not found. I am at a loss, I even tried using aptitude in a more dangerous way to get gcc-base 7 and it wound up removing a lot including my firefox browser so I just killed that before it could finish. I was afraid it was deleting too much of my installation. I am not sure why this is being so difficult. Any help is greatly appreciated!

Kulfy
  • 17,696

0 Answers0