解决Ubuntu20.04上保留的软件包

PLN*_*bie 7 upgrade package-management apt

您好,我最近将操作系统从 Ubuntu18.04 升级到 Ubuntu20.04。现在我注意到,当我这样做时sudo apt-get upgrade,我会保留包裹:

The following packages have been kept back:
  build-essential cpp g++ gcc gfortran liblapack-dev liblapack3
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
Run Code Online (Sandbox Code Playgroud)

我尝试了这里提到的方法。为了解决这个问题我尝试过

sudo apt-get dist-upgrade
Run Code Online (Sandbox Code Playgroud)

但输出和以前一样。

我还尝试了 sudo aptitude full-upgrade ,解决方案也是将软件包保持在当前版本。输出如下:

The following NEW packages will be installed:
  cpp-9{ab} g++-9{ab} gcc-9{ab} gfortran-9{ab} libasan5{ab} libgcc-9-dev{ab} libgfortran-9-dev{ab} libgfortran5{ab} libstdc++-9-dev{ab} 
  libubsan1{ab} 
The following packages will be upgraded:
  build-essential cpp g++ gcc gfortran liblapack-dev liblapack3 
7 packages upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 44.5 MB of archives. After unpacking 170 MB will be used.
The following packages have unmet dependencies:
 cpp-9 : Depends: gcc-9-base (= 9.3.0-17ubuntu1~20.04) but 9.4.0-1ubuntu1~18.04 is installed
 libgfortran-9-dev : Depends: gcc-9-base (= 9.3.0-17ubuntu1~20.04) but 9.4.0-1ubuntu1~18.04 is installed
 libasan5 : Depends: gcc-9-base (= 9.3.0-17ubuntu1~20.04) but 9.4.0-1ubuntu1~18.04 is installed
 libstdc++-9-dev : Depends: gcc-9-base (= 9.3.0-17ubuntu1~20.04) but 9.4.0-1ubuntu1~18.04 is installed
 libubsan1 : Depends: gcc-10-base (= 10.2.0-5ubuntu1~20.04) but 10.3.0-1ubuntu1~18.04~1 is installed
 g++-9 : Depends: gcc-9-base (= 9.3.0-17ubuntu1~20.04) but 9.4.0-1ubuntu1~18.04 is installed
 libgfortran5 : Depends: gcc-10-base (= 10.2.0-5ubuntu1~20.04) but 10.3.0-1ubuntu1~18.04~1 is installed
 gcc-9 : Depends: gcc-9-base (= 9.3.0-17ubuntu1~20.04) but 9.4.0-1ubuntu1~18.04 is installed
 gfortran-9 : Depends: gcc-9-base (= 9.3.0-17ubuntu1~20.04) but 9.4.0-1ubuntu1~18.04 is installed
 libgcc-9-dev : Depends: gcc-9-base (= 9.3.0-17ubuntu1~20.04) but 9.4.0-1ubuntu1~18.04 is installed
The following actions will resolve these dependencies:

      Keep the following packages at their current version:
1)      build-essential [12.4ubuntu1 (now)]                
2)      cpp [4:7.4.0-1ubuntu2.3 (now)]                     
3)      cpp-9 [Not Installed]                              
4)      g++ [4:7.4.0-1ubuntu2.3 (now)]                     
5)      g++-9 [Not Installed]                              
6)      gcc [4:7.4.0-1ubuntu2.3 (now)]                     
7)      gcc-9 [Not Installed]                              
8)      gfortran [4:7.4.0-1ubuntu2.3 (now)]                
9)      gfortran-9 [Not Installed]                         
10)     libasan5 [Not Installed]                           
11)     libgcc-9-dev [Not Installed]                       
12)     libgfortran-9-dev [Not Installed]                  
13)     libgfortran5 [Not Installed]                       
14)     liblapack-dev [3.7.1-4ubuntu1 (now)]               
15)     liblapack3 [3.7.1-4ubuntu1 (now)]                  
16)     libstdc++-9-dev [Not Installed]                    
17)     libubsan1 [Not Installed]      

           
Run Code Online (Sandbox Code Playgroud)

有人可以给我一些建议吗?谢谢!

PLN*_*bie 10

事实证明我需要sudo apt-get remove gcc-9-base然后sudo apt-get install gcc-9-base。gcc-10-base 也需要做同样的事情。