在 Ubuntu 18.10 中安装 GCC 时出错

在 Ubuntu 18.10 中安装 GCC 时出错

我真是个傻瓜,在安装 Ubuntu 18.10 时卸载了 GCC。在此过程中,DKMS 和 Nvidia 驱动程序也被删除了。经过长时间的斗争,我现在有了一个干净的软件包系统,但是当我尝试安装 gcc 时,我收到以下错误:

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)

相关内容