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