When I try
sudo apt install gcc
it gives
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.
So, I have 12.1.0-2ubuntu1~22.04 while gcc requires 12-20220319-1ubuntu1. When I try to update gcc-12-base it says
gcc-12-base is already the newest version (12.1.0-2ubuntu1~22.04).
I have searched gcc-12-base package at packages.ubuntu.com and found this. My PC's architecture is AMD64 and the version which gcc package requires is not for AMD64. What should I do?
Output of 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.
Output of 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.
I tried sudo aptitude why-not gcc
which outputs
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