当我尝试
sudo apt install gcc
它给
The following packages have unmet dependencies:
libatomic1 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.1.0-2ubuntu1~22.04 is to be installed
libcc1-0 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.1.0-2ubuntu1~22.04 is to be installed
libitm1 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.1.0-2ubuntu1~22.04 is to be installed
liblsan0 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.1.0-2ubuntu1~22.04 is to be installed
libquadmath0 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.1.0-2ubuntu1~22.04 is to be installed
libubsan1 : Depends: gcc-12-base (= 12-20220319-1ubuntu1) but 12.1.0-2ubuntu1~22.04 is to be installed
E: Unable to correct problems, you have held broken packages.
因此,我有 12.1.0-2ubuntu1~22.04,而 gcc 需要 12-20220319-1ubuntu1。当我尝试更新 gcc-12-base 时,它说
gcc-12-base is already the newest version (12.1.0-2ubuntu1~22.04).
我在 packages.ubuntu.com 上搜索了 gcc-12-base 包,发现这。我的电脑架构是 AMD64,而 gcc 包所需的版本不适用于 AMD64。我该怎么办?
输出sudo apt update
:
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
输出sudo apt upgrade
:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
我尝试了sudo aptitude why-not gcc
哪些输出
i libdpkg-perl Suggests gcc | c-compiler
p gcc Suggests flex
p flex:i386 Provides flex
p flex:i386 Recommends gcc:i386 | c-compiler:i386
p gcc:i386 Conflicts gcc