Ubuntu 更新错误修复大全

Ubuntu更新中,谁没有遇见个错误?在Ubuntu和其它基于Ubuntu的Linux发行版中,更新错误是一个共性的错误,也常常发生。这些错误出现的缘由多种多样,修复起来也很简单。在本文中,咱们将见到Ubuntu中各类类型频繁发生的更新错误以及它们的修复方法。linux

 

合并列表问题

当你在终端中运行更新命令时,你可能会碰到这个错误“合并列表错误”,就像下面这样:ubuntu

E:Encountered a section with no Package: header,服务器

E:Problem with MergeList /var/lib/apt/lists/archive.ubuntu.comubuntudistspreciseuniversebinary-i386Packages,ide

E:The package lists or status file could not be parsed or opened.’fetch

可使用如下命令来修复该错误:ui

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

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

 

下载仓库信息失败 -1

实际上,有两种类型的下载仓库信息失败错误。若是你的错误是这样的:.net

W:Failed to fetch bzip2:/var/lib/apt/lists/partial/in.archive.ubuntu.comubuntudistsoneiricrestrictedbinary-i386Packages Hash Sum mismatch,rest

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

相关文章
相关标签/搜索