BUG描述
前兩天在虛擬機(jī)Vmware中安裝了Ubuntu18.04操作系統(tǒng),因?yàn)樾枰惭b其他工具。所以想著執(zhí)行命令
sudo apt-get update
更新一下系統(tǒng),以便進(jìn)行安裝。結(jié)果出現(xiàn)“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'”的報(bào)錯(cuò)。
BUG解決思路
解決辦法是:修改系統(tǒng)源文件sources.list的源地址;如果未解決,檢查網(wǎng)絡(luò)是否被監(jiān)控,切換其他網(wǎng)絡(luò)試試,例如開(kāi)一個(gè)手機(jī)熱點(diǎn);更新過(guò)于老舊或者缺少的軟件包
BUG詳細(xì)解決辦法
一、修改系統(tǒng)源文件sources.list的源地址;
1、首先,先備份原來(lái)源文件sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bcakup
2、使用gedit編輯,更改源文件sources.list內(nèi)容
執(zhí)行命令:
sudo gedit /etc/apt/sources.list
?刪除sources.list內(nèi)容,并將以下內(nèi)容全部復(fù)制到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、重新執(zhí)行更新命令,更新軟件列表,檢測(cè)出可以更新的軟件。
sudo apt-get update
如果你那邊已經(jīng)解決了,沒(méi)有其他bug就可以不用看以下內(nèi)容了。但我按照上面操作,仍出現(xiàn)“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.”報(bào)錯(cuò),如下所示:
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'
后來(lái),根據(jù)csdn一篇博客,我新建手機(jī)熱點(diǎn)后,虛擬機(jī)中的操作系統(tǒng)改用手機(jī)熱點(diǎn)連接,發(fā)現(xiàn)可以更新完畢。
初步分析,應(yīng)該是公司的上網(wǎng)管理軟件進(jìn)行了限制,類似運(yùn)營(yíng)商的緩存劫持。
?
不過(guò),更新完了之后,還出現(xiàn)了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的報(bào)錯(cuò)。
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
這個(gè)問(wèn)題是由于安裝包過(guò)于老舊或者缺少軟件包
解決方法:
sudo apt --fix-broken install
執(zhí)行該操作以后,所有bug都全部修復(fù)。?
希望能幫到你!
參考
1、ubuntu apt update 報(bào)錯(cuò):無(wú)法安全地用該源進(jìn)行更新,所以默認(rèn)禁用該源文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-409620.html
2、dpkg dependency problems prevent configuration - 唐僧公子 - 博客園文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-409620.html
到了這里,關(guān)于【BUG解決】sudo apt-get update 報(bào)錯(cuò) E: The repository ‘http://xxx Release‘ does not have a Release file.的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!