yum Error: Cannot retrieve repository metadata (repomd.xml) for repository: xxxxx

NO IMAGE

問題:

使用如下命令從頭重建yum的庫,但是仍然出現錯誤:

[[email protected] ~]# yum clean all
...
Cleaning up Everything
Cleaning up list of fastest mirrors
[[email protected] ~]# rm -f /var/lib/rpm/__db*
[[email protected] ~]# rpm --rebuilddb
[[email protected] ~]# yum clean metadata
Loaded plugins: fastestmirror
...
0 metadata files removed
0 sqlite files removed
0 metadata files removed
[[email protected] ~]# yum makecache
Loaded plugins: fastestmirror
...
Determining fastest mirrors
addons                                                                                                                                | 1.9 kB     00:00     
addons/filelists_db                                                                                                                   |  568 B     00:00     
addons/other_db                                                                                                                       |  546 B     00:00     
addons/primary_db                                                                                                                     | 1.1 kB     00:00     
base                                                                                                                                  | 1.1 kB     00:00     
base/filelists                                                                                                                        | 3.6 MB     00:14     
base/other                                                                                                                            |  13 MB     00:32     
base/group                                                                                                                            | 1.1 MB     00:04     
base/primary                                                                                                                          | 1.2 MB     00:07     
extras                                                                                                                                | 2.1 kB     00:00     
extras/filelists_db                                                                                                                   | 227 kB     00:00     
extras/other_db                                                                                                                       | 399 kB     00:01     
extras/group                                                                                                                          | 9.7 kB     00:00     
extras/primary_db                                                                                                                     | 174 kB     00:00     
http://flexbox.sf.net/centos/5/x86_64/repodata/repomd.xml: [Errno 12] Timeout: <urlopen error timed out>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: flexbox. Please verify its path and try again

解決辦法:

1. 參考這裡http://forums.fedoraforum.org/showthread.php?t=223472的解決辦法,都試過還是不能解決問題。

a. 將https改為http;

b. 在/etc/hosts中新增

80.239.156.215          mirrors.fedoraproject.org
213.129.242.84          mirrors.rpmfusion.org

2. 參考這裡http://blog.csdn.net/sissiyinxi/article/details/7595617解決了上述錯誤。

a. 開啟/etc/yum.repos.d/xxxxx.repo,對於本例來說就是/etc/yum.repost.d/flexbox.repo

b. 將項[flexbox]中的enabled=1改為enabled=0

問題解決。