![Ubuntu 升级后,gcc、g++、gfortran 从系统中消失](https://linux22.com/image/955605/Ubuntu%20%E5%8D%87%E7%BA%A7%E5%90%8E%EF%BC%8Cgcc%E3%80%81g%2B%2B%E3%80%81gfortran%20%E4%BB%8E%E7%B3%BB%E7%BB%9F%E4%B8%AD%E6%B6%88%E5%A4%B1.png)
我已经将 Ubuntu 从 20.04lts 升级到 22.04lts。但是似乎 gcc、g++ 和 gfortran 已从系统中消失。我尝试过:
sudo apt install gcc
但出现错误:
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:
cpp-11 : Depends: gcc-11-base (= 11.4.0-1ubuntu1~22.04) but 11.4.0-2ubuntu1~20.04 is to be installed
gcc-11 : Depends: gcc-11-base (= 11.4.0-1ubuntu1~22.04) but 11.4.0-2ubuntu1~20.04 is to be installed
Depends: libgcc-11-dev (= 11.4.0-1ubuntu1~22.04) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我努力了
sudo apt install gcc-11-base
但它说已经安装到了最新版本,尝试安装libgcc-11-dev
会导致看似永无止境的未满足的依赖关系链。
我应该怎么办?
编辑根据要求,这是输出policy gcc-11-base
gcc-11-base:
Installed: 11.4.0-2ubuntu1~20.04
Candidate: 11.4.0-2ubuntu1~20.04
Version table:
*** 11.4.0-2ubuntu1~20.04 100
100 /var/lib/dpkg/status
11.4.0-1ubuntu1~22.04 500
500 http://it.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
11.2.0-19ubuntu1 500
500 http://it.archive.ubuntu.com/ubuntu jammy/main amd64 Packages