sudo apt-get install gcc-6 g++-6 -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gcc-6 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 sourcePackage g++-6 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
解决步骤
打开源配置文件 sudo vim /etc/apt/sources.list
在文件末尾增加 deb http://dk.archive.ubuntu.com/ubuntu/ bionic main universe 并保存退出