[Linux] 解決 CentOS 上 yum 遇到 HTTP 404 Not Found 的問題

[Linux] 解決 CentOS 上 yum 遇到 HTTP 404 Not Found 的問題

今天想用 yum 來查一下哪個套件包含了 stress 這支程式,

結果一直遇到 HTTP 404 錯誤:

testuser@localhost ~ $ yum provides */stress
......
http://debuginfo.centos.org/7/x86_64/repodata/3ff260768b1bb60b5bec1c543f4abb904b96c9f4-filelists.sqlite.bz2: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
 One of the configured repositories failed (CentOS-7 - Debuginfo),
 and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable base-debuginfo
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=base-debuginfo.skip_if_unavailable=true
failure: repodata/3ff260768b1bb60b5bec1c543f4abb904b96c9f4-filelists.sqlite.bz2 from base-debuginfo: [Errno 256] No more mirrors to try.
http://debuginfo.centos.org/7/x86_64/repodata/3ff260768b1bb60b5bec1c543f4abb904b96c9f4-filelists.sqlite.bz2: [Errno 14] HTTP Error 404 - Not Found

 

如果直接去下載那個 http://debuginfo.centos.org/…filelists.sqlite.bz2 的檔案,

的確是 HTTP 404 不存在,應該是那個檔案已經不存在 repo 之中了… 

問題是我也沒特別想要去抓這個 debug symbol 檔…

 

查了一下,有人說可以下 yum clean metadata 或是 yum clean all,

不過測試的結果,下 yum clean all 之後,還是會失敗,得再加上 yum update 才行:

yum clean all
sudo yum update

 

執行完上述兩個指令後,yum 指令就沒問題囉:

testuser@localhost ~ $ yum provides */stress
......
1:mariadb-test-5.5.44-2.el7.centos.x86_64 : The test suite distributed with MariaD
Repo        : base
Matched from:
Filename    : /usr/share/mysql-test/suite/stress
1:mariadb-test-5.5.47-1.el7_2.x86_64 : The test suite distributed with MariaD
Repo        : updates
Matched from:
Filename    : /usr/share/mysql-test/suite/stress
ras-utils-7.0-6.el7.x86_64 : RAS Utilities
Repo        : base
Matched from:
Filename    : /opt/mce-test/mce-test-a4c080bd/groups/stress
Filename    : /opt/mce-test/mce-test-a4c080bd/cases/stress

 

參考資料: 

[Errno 14] HTTP Error 404 – Not Found

How to fix yum errors on CentOS, RHEL or Fedora

(本頁面已被瀏覽過 5,250 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料