我在 VirtualBox 中安装了 Ubuntu 18.04.1 LTS。我想在其中使用 gcc,但它没有预安装的版本,当我尝试安装时,它显示以下消息:
sudo apt-get install gcc
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
答案1
在尝试安装gcc
或在新安装中安装任何其他程序之前,您应该先更新软件包列表:
sudo apt update
然后按通常方式安装您想要的程序。(sudo apt install <package-name>
)