2012-09-27 21 views
0

我只是嘗試安裝libperl-dev的用apt在Ubuntu,但我有以下錯誤:APT錯誤:依賴:perl的(= 5.14.2-6ubuntu2),但5.14.2-6ubuntu2.1是要安裝

[email protected]:~$ sudo apt-get install libperl-dev 
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: 
libperl-dev : Depends: perl (= 5.14.2-6ubuntu2) but 5.14.2-6ubuntu2.1 is to be installed 
       Depends: libperl5.14 (= 5.14.2-6ubuntu2) but 5.14.2-6ubuntu2.1 is to be installed 
E: Unable to correct problems, you have held broken packages. 

我試圖谷歌的問題,但沒有找到明確的東西。
有人可以解釋一下它的含義:「取決於:libperl5.14(= 5.14.2-6ubuntu2)但5.14.2-6ubuntu2.1將被安裝」,以及如何解決它?
謝謝你的提前。

回答

1

基本上錯誤消息告訴你所有三個軟件包(libperl-dev,perl和libperl5.14)需要有完全相同的版本(5.14.2-6ubuntu2或5.14.2-6ubuntu2.1),但你正試圖混合兩者。我不能告訴你爲什麼會這樣(也許你試圖混合來自不同發行版的軟件包,比如debian testing/unstable),但是如果你使用aptitude,你可以在交互式依賴解析器中檢查情況(也許它甚至會自動爲您找到可接受的解決方案)。

因此,使用aptitude並檢查軟件包的版本,包括那些您正在嘗試安裝的版本以及您已經擁有的版本。

+0

你能給我一些鏈接來閱讀關於交互式依賴求解器嗎? – rodnower

+0

畢竟我只是從這裏下載軟件包:https://launchpad.net/ubuntu/precise/i386/libperl-dev/5.14.2-6ubuntu2.1我可以將這個網站設置爲apt的存儲庫嗎? – rodnower

0

沒有直接回答你的問題,但一個方法來避免它發生:

你不應該用你的系統的Perl反覆折騰得多。因爲很多系統包依賴於系統Perl。如果你搞砸了,你的系統可能會遇到麻煩。

如果您想靈活使用Perl安裝,請始終使用Perlbrew!去這個網站,這很容易:http://perlbrew.pl/ Perlbrew管理不同的Perls,並且都安全地在你的$家裏。 (Perlbrew也對CPAN或可作爲.deb軟件包,但使用的網站上面,它是保護)

如果你那麼這行添加到您的.bashrc

# Perl is always from perlbrew! 
source ~/perl5/perlbrew/etc/bashrc 

可以使用perlbrew命令在您的終端上輕鬆切換Perl安裝。

也許這對你有幫助嗎? Regards

+1

這是誤導人的地獄。至少在Debian上(我相信Ubuntu在這方面應該是相似的),perl並不是一個必需的軟件包,系統軟件包都不依賴於它。其次,當用戶顯然只需要更新他的發行版軟件包時,建議安裝第二個perl,就不在話下了。 – jpalecek