内容目录
今天给我 NAS 换上了 RTX 2060,安装 nv 专有驱动的时候报错没有 gcc,于是考虑安装 build-essential,结果报错:
madray@NAS:~$ sudo apt install build-essential
Reading package lists... Done
Building dependency tree... Done
Reading state information... 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 of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
libstdc++-12-dev : Depends: libc6-dev (>= 2.23-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
首先尝试 apt upgrade
,无果;然后尝试手动安装 libc6-dev
:
madray@NAS:~$ sudo apt install libc6-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... 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 of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libc6-dev : Depends: libc6 (= 2.36-9+deb12u9) but 2.36-9+deb12u4 is to be installed
E: Unable to correct problems, you have held broken packages.
继续尝试手动安装 libc6
:
madray@NAS:~$ sudo apt install libc6
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
glibc-doc libnss-nis libnss-nisplus
The following held packages will be changed:
libc6
The following packages will be upgraded:
libc6
1 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.
Need to get 2,757 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm/main amd64 libc6 amd64 2.36-9+deb12u9 [2,757 kB]
Fetched 2,757 kB in 2s (1,217 kB/s)
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 77973 files and directories currently installed.)
Preparing to unpack .../libc6_2.36-9+deb12u9_amd64.deb ...
Unpacking libc6:amd64 (2.36-9+deb12u9) over (2.36-9+deb12u4) ...
Setting up libc6:amd64 (2.36-9+deb12u9) ...
Processing triggers for libc-bin (2.36-9+deb12u4) ...
ldconfig: /usr/local/lib/libzmq.so.5 is not a symbolic link
然后重新依次尝试安装 libc6-dev
、build-essential
就成功了。