![由于 libc6-dev 依赖,Ubuntu 24.04 全新安装时 Build Essential 安装失败](https://linux22.com/image/950067/%E7%94%B1%E4%BA%8E%20libc6-dev%20%E4%BE%9D%E8%B5%96%EF%BC%8CUbuntu%2024.04%20%E5%85%A8%E6%96%B0%E5%AE%89%E8%A3%85%E6%97%B6%20Build%20Essential%20%E5%AE%89%E8%A3%85%E5%A4%B1%E8%B4%A5.png)
sudo apt-get install --yes build-essential
Reading package lists... Done
Building dependency tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out on Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libc6-dev : Depends: libc6 (= 2.35-0ubuntu3) but 2.35-0ubuntu3.1 is to be installed
Depends: libtirpc-dev but it is not going to be installed
Depends: libnsl-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages
不知道为什么会发生这种情况。我是 Linux 新手,这是一个全新的安装。我只是想安装一些我需要使用其他程序的软件包,但构建必需品总是失败。我在网上看到这可能与 libc6-dev 的较新版本有关,但我尝试了网上人们提供的所有不同方法,但都不起作用。希望这里有人能帮忙。谢谢!
答案1
看起来您需要先进行更新:
sudo apt update
重试后:
sudo apt install build-essential