在ubuntu更新中,誰沒有碰見個錯誤?在ubuntu和其它基于ubuntu的linux發行版中,更新錯誤是一個共性的錯誤,也經常發生。這些錯誤出現的原因多種多樣,修複起來也很簡單。在本文中,我們将見到ubuntu中各種類型頻繁發生的更新錯誤以及它們的修複方法。
<a target="_blank"></a>
e:encountered a section with no package: header, e:problem with mergelist /var/lib/apt/lists/archive.ubuntu.comubuntudistspreciseuniversebinary-i386packages, e:the package lists or status file could not be parsed or opened.’
可以使用以下指令來修複該錯誤:
<code>sudo rm -r /var/lib/apt/lists/*</code>
<code>sudo apt-get clean && sudo apt-get update</code>
w:failed to fetch bzip2:/var/lib/apt/lists/partial/in.archive.ubuntu.comubuntudistsoneiricrestrictedbinary-i386packages hash sum mismatch, w:failed to fetch bzip2:/var/lib/apt/lists/partial/in.archive.ubuntu.comubuntudistsoneiricmultiversebinary-i386packages hash sum mismatch, e:some index files failed to download. they have been ignored, or old ones used instead
那麼,你可以用以下指令修複:
<code>sudo rm -rf /var/lib/apt/lists/*</code>
<code>sudo apt-get update</code>
下載下傳倉庫資訊失敗的另外一種類型是由于ppa過時導緻的。通常,當你運作更新管理器,并看到這樣的錯誤時:

該錯誤很容易修複,隻需修改軟體源為主伺服器即可。轉到“軟體和更新”,在那裡你可以修改下載下傳伺服器為主伺服器:
not all updates can be installed run a partial upgrade, to install as many updates as possible
在終端中運作以下指令來修複該錯誤:
<code>sudo apt-get install -f</code>
該錯誤更多是安裝錯誤,而不是更新錯誤。如果嘗試從源碼安裝程式,你可能會碰到這個錯誤:
error while loading shared libraries: cannot open shared object file: no such file or directory
該錯誤可以通過在終端中運作以下指令來修複:
<code>sudo /sbin/ldconfig -v</code>
在另一個程式在使用apt時,會發生該錯誤。假定你正在ubuntu軟體中心安裝某個東西,然後你又試着在終端中運作apt。
e: could not get lock /var/cache/apt/archives/lock – open (11: resource temporarily unavailable) e: unable to lock directory /var/cache/apt/archives/
通常,隻要你把所有其它使用apt的程式關了,這個問題就會好的。但是,如果問題持續,可以使用以下指令:
<code>sudo rm /var/lib/apt/lists/lock</code>
如果上面的指令不起作用,可以試試這個指令:
<code>sudo killall apt-get</code>
我們所要做的,就是擷取系統中的這個公鑰,從資訊中擷取密鑰号。在上述資訊中,密鑰号為68980a0ea10b4de8。該密鑰可通過以下方式使用:
<code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68980a0ea10b4de8</code>
在添加密鑰後,再次運作更新就沒有問題了。
要修複該badsig錯誤,請在終端中使用以下指令:
<code>sudo apt-get clean</code>
<code>cd /var/lib/apt</code>
<code>sudo mv lists oldlist</code>
<code>sudo mkdir -p lists/partial</code>
本文彙集了你可能會碰到的ubuntu更新錯誤,我希望這會對你處理這些錯誤有所幫助。你在ubuntu中是否也碰到過其它更新錯誤呢?請在下面的評論中告訴我,我會試着寫個快速指南。
<b>原文釋出時間為:2015-06-11</b>
<b>本文來自雲栖社群合作夥伴“linux中國”</b>