2016-03-11 188 views
-1

我無法在新安裝的Ubuntu 14.04.4 LTS上安裝g ++。無法在ubuntu 14.04.4 LTS上安裝g ++

當我使用命令sudo apt-get install g++,終端告訴我:

[email protected]:~$ sudo apt-get install g++ 
[sudo] password for cluster: 
Reading package lists... Done 
Building dependency tree  
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: 
g++ : Depends: g++-4.8 (>= 4.8.2-5~) but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

我改變了來源,並再次嘗試,失敗了。

[email protected]:~$ sudo apt-get install g++ 
Reading package lists... Done 
Building dependency tree 
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: 
g++:i386 : Depends: cpp:i386 (>= 4:4.7.3-1ubuntu10) but it is not going to be installed 
      Depends: gcc:i386 (>= 4:4.7.3-1ubuntu10) but it is not going to be installed 
      Depends: g++-4.7:i386 (>= 4.7.3-1~) but it is not going to be installed 
      Depends: gcc-4.7:i386 (>= 4.7.3-1~) but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

我使用的Ubuntu軟件中心安裝G ++,又失敗了...... Figure: Use ubuntu software center to install g++

這個問題已經通過改變其它來源解決。

我已經嘗試了4個來源,並且他們都有問題...... OMG!

+0

查看https://askubuntu.com/questions/118749/package-system-is-broken-how-to-fix-it – sashoalm

回答

1

我認爲這將有助於:

sudo apt-get update 
sudo apt-get -f install 
sudo dpkg --configure -a 
sudo apt-get clean 
sudo apt-get install g++ 

而且這可能幫助:

sudo dpkg --purge g++# Try this first 
sudo dpkg --purge --force-depends g++# Try this ONLY if the previous line fails 
sudo apt-get clean g++# Remove g++ from the cache 
sudo apt-get install g++# Download and install the appropriate version of g++ 
+0

它不能解決這個問題...... – xysmlx

+0

你仍然有同樣的錯誤? – alexey

+0

是的,同樣的錯誤。 – xysmlx

0

如果我猜的話,我會說有其他的libc6,的libc-dev的,等等。在更新C和G之前需要更新的文件。如果你在ubuntu軟件包網站上查找文件並查看依賴關係,然後將它們與機器上的內容進行比較,我敢打賭,你在未來幾天會有更新版本。 您可以手動將它們下載到頁面底部(一個小表),然後雙擊deb文件,如果滿足依賴關係,它們將開始安裝。

認爲它是「A依賴於B,其取決於基於C依賴於d ......」正在安裝。