sudo apt install gcc
报错信息
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package gcc is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
gcc-9-doc gcc-10-doc
E: Package ‘gcc’ has no installation candidate
解决
通过命令
sudo apt-get update 升级软件源
sudo apt-get upgrade 升级软件
sudo aptitude install gcc