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 -r /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更新失敗,你可以把它從源列表中刪除。你可以按照這個截圖指南來修復下載倉庫信息失敗錯誤

 下載倉庫信息失敗 -3

版本錯誤導致找不到源

W: The repository 'http://ppa.launchpad.net/bzindovic/suitesparse-bugfix-1319687/ubuntu xenial Release' does not have a Release file.
解決辦法,刪除出錯的源

sudo rm /etc/apt/sources.list.d/bzindovic-ubuntu-suitesparse-bugfix-1319687-xenial.list
sudo rm /etc/apt/sources.list.d/bzindovic-ubuntu-suitesparse-bugfix-1319687-xenial.list.save

 

apt源重復

W: Target Packasges (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list.d/realsense-public.list:1

解決辦法,刪除重復的源

sudo rm /etc/apt/sources.list.d/realsense-public.list
sudo rm /etc/apt/sources.list.d/realsense-public.list.save

 

下載包文件失敗錯誤

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

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

 

部分更新錯誤

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

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM