Ubuntu 更新錯誤修複大全

來源:互聯網
上載者:User

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

 

下載包檔案失敗錯誤

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

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

 

部分更新錯誤

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

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

本文彙集了你可能會碰到的Ubuntu更新錯誤,我希望這會對你處理這些錯誤有所協助。你在Ubuntu中是否也碰到過其它更新錯誤呢?請在下面的評論中告訴我,我會試著寫個快速指南。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.