1

I have been a complete fool and uninstalled GCC from Ubuntu 18.10 installation. In the process DKMS and Nvidia driver has also been removed. After a long battle I now have a clean package system, but when I try to install gcc I get the following error:

sudo apt-get install gcc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  gcc-multilib libtool flex bison gcc-doc
The following NEW packages will be installed:
  gcc
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,220 B of archives.
After this operation, 51.2 kB of additional disk space will be used.
Get:1 http://dk.archive.ubuntu.com/ubuntu cosmic/main amd64 gcc amd64 4:8.2.0-1ubuntu1 [5,220 B]
Fetched 5,220 B in 0s (72.6 kB/s)
Selecting previously unselected package gcc.
(Reading database ... 231772 files and directories currently installed.)
Preparing to unpack .../gcc_4%3a8.2.0-1ubuntu1_amd64.deb ...
Unpacking gcc (4:8.2.0-1ubuntu1) ...
Setting up gcc (4:8.2.0-1ubuntu1) ...
update-alternatives: error: alternative path /usr/bin/gcc doesn't exist
dpkg: error processing package gcc (--configure):
 installed gcc package post-installation script subprocess returned error exit status 2
Processing triggers for man-db (2.8.4-2) ...
Errors were encountered while processing:
 gcc
E: Sub-process /usr/bin/dpkg returned an error code (1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.