Ubuntu 更新錯誤修復大全

Ubuntu更新中,誰沒有碰見個錯誤?在Ubuntu和其它基於Ubuntu的Linux發行版中,更新錯誤是一個共性的錯誤,也經常發生。這些錯誤出現的原因多種多樣,修復起來也很簡單。在本文中,我們將見到Ubuntu中各種類型頻繁發生的更新錯誤以及它們的修復方法。

 

合併列表問題

當你在終端中運行更新命令時,你可能會碰到這個錯誤“合併列表錯誤”,就像下面這樣:

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.’

可以使用以下命令來修復該錯誤:

  1. sudo rm -/var/lib/apt/lists/*

  2. sudo apt-get clean && sudo apt-get update

 

下載倉庫信息失敗 -1

實際上,有兩種類型的下載倉庫信息失敗錯誤。如果你的錯誤是這樣的:

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

那麼,你可以用以下命令修復:

  1. sudo rm -rf /var/lib/apt/lists/*

  2. sudo apt-get update

 

下載倉庫信息失敗 -2

下載倉庫信息失敗的另外一種類型是由於PPA過時導致的。通常,當你運行更新管理器,並看到這樣的錯誤時:

你可以運行sudo apt-get update來查看哪個PPA更新失敗,你可以把它從源列表中刪除。你可以按照這個截圖指南來修復下載倉庫信息失敗錯誤

 

下載包文件失敗錯誤

一個類似的錯誤是下載包文件失敗錯誤,像這樣:

該錯誤很容易修復,只需修改軟件源爲主服務器即可。轉到“軟件和更新”,在那裏你可以修改下載服務器爲主服務器:

 

部分更新錯誤

在終端中運行更新會出現部分更新錯誤

Not all updates can be installed

Run a partial upgrade, to install as many updates as possible

在終端中運行以下命令來修復該錯誤:

  1. sudo apt-get install -f

 

加載共享庫時發生錯誤

該錯誤更多是安裝錯誤,而不是更新錯誤。如果嘗試從源碼安裝程序,你可能會碰到這個錯誤:

error while loading shared libraries:

cannot open shared object file: No such file or directory

該錯誤可以通過在終端中運行以下命令來修復:

  1. sudo /sbin/ldconfig -v

你可以在這裏查找到更多詳細內容加載共享庫時發生錯誤

 

無法獲取鎖 /var/cache/apt/archives/lock

在另一個程序在使用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的程序關了,這個問題就會好的。但是,如果問題持續,可以使用以下命令:

  1. sudo rm /var/lib/apt/lists/lock

如果上面的命令不起作用,可以試試這個命令:

  1. sudo killall apt-get

關於該錯誤的更多信息,可以在這裏找到。

 

GPG錯誤: 下列簽名無法驗證

在添加一個PPA時,可能會導致以下錯誤GPG錯誤: 下列簽名無法驗證,這通常發生在終端中運行更新時:

W: GPG error: http://repo.mate-desktop.org saucy InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 68980A0EA10B4DE8

我們所要做的,就是獲取系統中的這個公鑰,從信息中獲取密鑰號。在上述信息中,密鑰號爲68980A0EA10B4DE8。該密鑰可通過以下方式使用:

  1. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68980A0EA10B4DE8

在添加密鑰後,再次運行更新就沒有問題了。

 

BADSIG錯誤

另外一個與簽名相關的Ubuntu更新錯誤是BADSIG錯誤,它看起來像這樣:

W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://extras.ubuntu.com precise Release: The following signatures were invalid: BADSIG 16126D3A3E5C1192 Ubuntu Extras Archive Automatic Signing Key

W: GPG error: http://ppa.launchpad.net precise Release:

The following signatures were invalid: BADSIG 4C1CBC1B69B0E2F4 Launchpad PPA for Jonathan French W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release

要修復該BADSIG錯誤,請在終端中使用以下命令:

  1. sudo apt-get clean

  2. cd /var/lib/apt

  3. sudo mv lists oldlist

  4. sudo mkdir -p lists/partial

  5. sudo apt-get clean

  6. sudo apt-get update

轉自:http://www.linuxidc.com/Linux/2015-06/118678.htm

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章