yum 无法使用的解决

在网上看到的解决方法,故保存于此。


问题:Loaded plugins: fastestmirror Determining fastest mirrors YumRepo Error:
All mirror URLs are not using ftp, http[s] or file. /Eg. removing
mirrorlist with no valid mirrors: /var/cache/yum/addons/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: addons


解决方法:vim /var/cache/yum/base/mirrorlist.txt

内容:http://mirrors.163.com/centos/5.7/os/x86_64/
http://centos.ustc.edu.cn/centos/5.7/os/x86_64/
http://mirror.neu.edu.cn/centos/5.7/os/x86_64/
http://mirrors.ta139.com/centos/5.7/os/x86_64/
http://ftp.nsysu.edu.tw/CentOS/5.7/os/x86_64/
http://ftp.tc.edu.tw/Linux/CentOS/5.7/os/x86_64/
http://ftp.isu.edu.tw/pub/Linux/CentOS/5.7/os/x86_64/
http://ftp.stu.edu.tw/Linux/CentOS/5.7/os/x86_64/
http://ftp.twaren.net/Linux/CentOS/5.7/os/x86_64/
http://ftp.cs.pu.edu.tw/Linux/CentOS/5.7/os/x86_64/
http://mirror01.idc.hinet.net/CentOS/5.7/os/x86_64/
http://centos.mirror.cdnetworks.com/5.7/os/x86_64/
http://centos.tt.co.kr/5.7/os/x86_64/
http://data.nicehosting.co.kr/os/CentOS/5.7/os/x86_64/
http://mirror.khlug.org/centos/5.7/os/x86_64/
http://mirror.yongbok.net/centos/5.7/os/x86_64/
http://ftp.daum.net/centos/5.7/os/x86_64/
http://mirror.nus.edu.sg/centos/5.7/os/x86_64/
http://mirror.averse.net/centos/5.7/os/x86_64/
http://mirrors.sin1.sg.voxel.net/centos/5.7/os/x86_64/

vim /var/cache/yum/updates/mirrorlist.txt

内容:

http://mirror.neu.edu.cn/centos/5.7/updates/x86_64/
http://mirrors.ta139.com/centos/5.7/updates/x86_64/
http://mirrors.stuhome.net/centos/5.7/updates/x86_64/
http://centos.ustc.edu.cn/centos/5.7/updates/x86_64/
http://ftp.stu.edu.tw/Linux/CentOS/5.7/updates/x86_64/
http://mirror01.idc.hinet.net/CentOS/5.7/updates/x86_64/
http://ftp.tc.edu.tw/Linux/CentOS/5.7/updates/x86_64/
http://ftp.isu.edu.tw/pub/Linux/CentOS/5.7/updates/x86_64/
http://ftp.cs.pu.edu.tw/Linux/CentOS/5.7/updates/x86_64/
http://ftp.daum.net/centos/5.7/updates/x86_64/
http://mirror.khlug.org/centos/5.7/updates/x86_64/
http://data.nicehosting.co.kr/os/CentOS/5.7/updates/x86_64/
http://centos.tt.co.kr/5.7/updates/x86_64/
http://mirror.averse.net/centos/5.7/updates/x86_64/
ftp://ftp.oss.eznetsols.org/linux/centos/5.7/updates/x86_64/
http://mirror.nus.edu.sg/centos/5.7/updates/x86_64/
http://mirrors.sin1.sg.voxel.net/centos/5.7/updates/x86_64/
http://centos.vr-zone.com/5.7/updates/x86_64/
http://rsync.atworks.co.jp/centos/5.7/updates/x86_64/
http://ftp.nara.wide.ad.jp/pub/Linux/centos/5.7/updates/x86_64/


vim  /var/cache/yum/addons/mirrorlist.txt

内容:

http://mirror.centos.org/centos/5/addons/x86_64/

vim /var/cache/yum/extras/mirrorlist.txt

内容:

http://centos.ustc.edu.cn/centos/5.7/extras/x86_64/
http://mirrors.stuhome.net/centos/5.7/extras/x86_64/
http://mirror.neu.edu.cn/centos/5.7/extras/x86_64/
http://mirrors.ta139.com/centos/5.7/extras/x86_64/
http://ftp.cs.pu.edu.tw/Linux/CentOS/5.7/extras/x86_64/
http://ftp.stu.edu.tw/Linux/CentOS/5.7/extras/x86_64/
http://ftp.tc.edu.tw/Linux/CentOS/5.7/extras/x86_64/
http://ftp.isu.edu.tw/pub/Linux/CentOS/5.7/extras/x86_64/
http://mirror01.idc.hinet.net/CentOS/5.7/extras/x86_64/
http://data.nicehosting.co.kr/os/CentOS/5.7/extras/x86_64/
http://mirror.khlug.org/centos/5.7/extras/x86_64/
http://ftp.daum.net/centos/5.7/extras/x86_64/
http://centos.tt.co.kr/5.7/extras/x86_64/
http://centos.vr-zone.com/5.7/extras/x86_64/
http://mirror.averse.net/centos/5.7/extras/x86_64/
http://mirrors.sin1.sg.voxel.net/centos/5.7/extras/x86_64/
ftp://ftp.oss.eznetsols.org/linux/centos/5.7/extras/x86_64/
http://mirror.nus.edu.sg/centos/5.7/extras/x86_64/
http://ftp.yz.yamagata-u.ac.jp/pub/linux/centos/5.7/extras/x86_64/
http://ftp.jaist.ac.jp/pub/Linux/CentOS/5.7/extras/x86_64/

若仍不能使用,在root用户下    #yum clean all          //清除RPM

                                                   #yum update             //更新下载即可,要联网。。。。


               原文链接:http://www.douban.com/note/199760527/

你可能感兴趣的:(linux)