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

转载于:https://www.cnblogs.com/long5683/p/11452567.html

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当在Ubuntu更新缓存时出现错误257时,这通常是由于软件源列表中某些仓库的问题导致的。下面是一些可能的解决方法: 1. 打开终端并使用以下命令编辑软件源列表文件: ``` sudo gedit /etc/apt/sources.list ``` 2. 检查文件中的每个仓库,并确保其格式正确。确保每行以 "deb" 或 "deb-src" 开头,后面跟着仓库的地址。如果发现任何错误或无效的仓库,请将其删除或注释掉。 3. 如果错误257与特定的PPA仓库相关,您可以使用以下命令将其移除: ``` sudo add-apt-repository --remove ppa:对应的仓库名称 ``` 4. 如果您对软件源列表文件进行了更改,记得在完成后运行以下命令以更新缓存: ``` sudo apt update ``` 如果上述解决方法无效,您可以尝试使用备份的软件源列表文件恢复到之前的状态: 1. 复制原来的软件源列表文件保存到其他位置。 2. 使用备份文件替换当前的软件源列表文件。 请注意,在进行任何更改之前,建议您备份当前的软件源列表文件,以防出现问题。 希望以上的解决方法能够帮助您解决Ubuntu更新缓存时出现的错误257。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [【Linux-Ubuntu】apt-get update软件更新的时候经常出错](https://blog.csdn.net/zhinengxiong6/article/details/127163218)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [ubuntu 出现没有Release文件, 更新缓存时出错](https://blog.csdn.net/qq_45642410/article/details/114357632)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值