无法安装 C++ 库

无法安装 C++ 库

我想安装 C++ 库,但终端一直要求我插入 CD 进行安装。什么 CD?

这是我用来尝试安装的终端代码:

sudo apt-get install build-essential

输入密码并点击后y,系统显示:媒体更改

为什么这么说?有人能帮我解决这个问题吗?或者找到另一种安装 C++ 库的方法吗?谢谢。

答案1

这似乎是因为您使用 CD/DVD 而不是在线存储库来安装系统。当您尝试使用包管理器时,它指的是那些 CD。

您可能需要在 /etc/apt/sources.list 或 /etc/apt/sources.list.d 中添加 Ubuntu 存储库

使用网络启动映像安装的 Ubuntu Precise 的默认内容/etc/apt/sources.list如下:

deb http://archive.ubuntu.com/ubuntu precise main restricted
deb-src http://archive.ubuntu.com/ubuntu precise main restricted

deb http://archive.ubuntu.com/ubuntu precise-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted

deb http://archive.ubuntu.com/ubuntu precise universe
deb-src http://archive.ubuntu.com/ubuntu precise universe
deb http://archive.ubuntu.com/ubuntu precise-updates universe
deb-src http://archive.ubuntu.com/ubuntu precise-updates universe

deb http://archive.ubuntu.com/ubuntu precise multiverse
deb-src http://archive.ubuntu.com/ubuntu precise multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-updates multiverse

deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

然后apt-get update按照之前尝试的方式运行并安装 buil-essential 包。

相关内容