更新困境:libstdc++6

更新困境:libstdc++6

我似乎无法更新 libstdc++6。我怀疑是某个 PPA 安装了它,现在我无法摆脱它。

有什么帮助吗?

; sudo apt upgrade gcc g++ cpp build-essential                                 
Reading package lists... Done                                                   
Building dependency tree                                                        
Reading state information... Done                                               
You might want to run ‘apt-get -f install’ to correct these.                    
The following packages have unmet dependencies.                                 
 libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.10) but 5.4.1-2ubuntu1~12.04 is installed                                                             
E: Unmet dependencies. Try using -f.   

; sudo apt remove gcc-5-base                                                    
Reading package lists... Done                                                   
Building dependency tree                                                        
Reading state information... Done                                               
You might want to run 'apt-get -f install' to correct these:                    
The following packages have unmet dependencies.                                 
 gcj-5-jre-lib : Depends: gcc-5-base (>= 5.2.1-23) but it is not going to be installed                                                                          
 libgcj16 : Depends: gcc-5-base (>= 5.2.1-23) but it is not going to be installed                                                                               
 libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.10) but it is not going to be installed                                                               
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).     

; sudo apt-get -f install                                                       
Reading package lists... Done                                                   
Building dependency tree                                                        
Reading state information... Done                                               
Correcting dependencies... failed.                                              
The following packages have unmet dependencies.                                 
 libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.10) but 5.4.1-2ubuntu1~12.04 is installed                                                             
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.                                                                    
E: Unable to correct dependencies 

附言:这很奇怪:lsb_release -a显示我正在运行Ubuntu 16.04.5 LTS。但是,我刚刚升级到 18.04……我认为刚刚升级到 16……这有点道理。标签已编辑。

答案1

我似乎已经解决了:

  1. 下载 libstdc++ 的包。
  2. 通过 降级 gcc apt-get install gcc-5-base=5.4.0-6ubuntu1~16.04.10
  3. 手动安装:dpkg -i libstdc++6_5.4.0-6ubuntu1\~16.04.10_amd64.deb

至少错误已经消失。

相关内容