无法安装 gcc,您持有损坏的软件包

无法安装 gcc,您持有损坏的软件包

我正在尝试安装 gcc,但一直收到此消息:

~$ sudo apt install gcc make gdb valgrind git

Reading package lists... Done
Building dependency tree       
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.
 gcc : Depends: gcc-9 (>= 9.3.0-3~) but it is not going to be installed
       Recommends: libc6-dev but it is not going to be installed or
                   libc-dev
 valgrind : Depends: libc6-dbg but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我应该怎么办?

答案1

你可以试试

sudo apt -f install

并重新运行你的命令以获取更多信息请访问此 地点

相关内容