【BUG解决】sudo apt-get update 报错 E: The repository ‘http://xxx Release‘ does not have a Release file.

这篇具有很好参考价值的文章主要介绍了【BUG解决】sudo apt-get update 报错 E: The repository ‘http://xxx Release‘ does not have a Release file.。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

BUG描述

前两天在虚拟机Vmware中安装了Ubuntu18.04操作系统,因为需要安装其他工具。所以想着执行命令

sudo apt-get update

更新一下系统,以便进行安装。结果出现“E: The repository ‘http://xxx Release‘ does not have a Release file.”以及“E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'”的报错。

BUG解决思路

解决办法是:修改系统源文件sources.list的源地址;如果未解决,检查网络是否被监控,切换其他网络试试,例如开一个手机热点;更新过于老旧或者缺少的软件包

BUG详细解决办法

一、修改系统源文件sources.list的源地址;

1、首先,先备份原来源文件sources.list

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bcakup

2、使用gedit编辑,更改源文件sources.list内容

执行命令:

sudo gedit /etc/apt/sources.list

 删除sources.list内容,并将以下内容全部复制到sources.list中

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

保存文件,退出。

3、重新执行更新命令,更新软件列表,检测出可以更新的软件。

sudo apt-get update

如果你那边已经解决了,没有其他bug就可以不用看以下内容了。但我按照上面操作,仍出现“E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.”报错,如下所示:

Ign:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
Ign:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
Ign:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
Ign:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
Ign:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
Err:6 http://mirrors.aliyun.com/ubuntu bionic Release 
  SECURITY: URL redirect target contains control characters, rejecting. [IP: 119.96.136.238 80]
Err:7 http://mirrors.aliyun.com/ubuntu bionic-security Release
  SECURITY: URL redirect target contains control characters, rejecting. [IP: 119.96.136.238 80]
Err:8 http://mirrors.aliyun.com/ubuntu bionic-updates Release
  SECURITY: URL redirect target contains control characters, rejecting. [IP: 119.96.136.238 80]
Err:9 http://mirrors.aliyun.com/ubuntu bionic-proposed Release
  SECURITY: URL redirect target contains control characters, rejecting. [IP: 119.96.136.238 80]
Err:10 http://mirrors.aliyun.com/ubuntu bionic-backports Release
  SECURITY: URL redirect target contains control characters, rejecting. [IP: 119.96.136.238 80]
appstreamcli: error while loading shared libraries: libxapian.so.22: cannot open shared object file: No such file or directory
Reading package lists... Done
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-proposed Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'

后来,根据csdn一篇博客,我新建手机热点后,虚拟机中的操作系统改用手机热点连接,发现可以更新完毕。

初步分析,应该是公司的上网管理软件进行了限制,类似运营商的缓存劫持。
 

不过,更新完了之后,还出现了appstreamcli: error while loading shared libraries: libxapian.so.22: cannot open shared object file: No such file or directory
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'
E: Sub-process returned an error code的报错。

Fetched 70.8 MB in 4min 20s (272 kB/s)                                         
appstreamcli: error while loading shared libraries: libxapian.so.22: cannot open shared object file: No such file or directory
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'
E: Sub-process returned an error code

这个问题是由于安装包过于老旧或者缺少软件包

解决方法:

sudo apt --fix-broken install

执行该操作以后,所有bug都全部修复。 

希望能帮到你!

【BUG解决】sudo apt-get update 报错 E: The repository ‘http://xxx Release‘ does not have a Release file.

【BUG解决】sudo apt-get update 报错 E: The repository ‘http://xxx Release‘ does not have a Release file.

【BUG解决】sudo apt-get update 报错 E: The repository ‘http://xxx Release‘ does not have a Release file.

参考

1、ubuntu apt update 报错:无法安全地用该源进行更新,所以默认禁用该源

2、dpkg dependency problems prevent configuration - 唐僧公子 - 博客园文章来源地址https://www.toymoban.com/news/detail-409620.html

到了这里,关于【BUG解决】sudo apt-get update 报错 E: The repository ‘http://xxx Release‘ does not have a Release file.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包