I have upgraded Ubuntu from 20.04lts to 22.04lts. However it seems that gcc, g++ and gfortran have disappeared from the system. I have tried:
sudo apt install gcc
but got the error:
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.
I have tried
sudo apt install gcc-11-base
But it says that it is already installed to the latest version and trying to install libgcc-11-dev leads to a seemingly never-ending chain of unmet dependencies.
What should I do?
EDIT As requested this is the output of 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