Centos yum异常问题


搭建环境时碰到yum更新出问题了,报如下错误:YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. $releasever is not a valid release or hasnt been released yet/
removing mirrorlist with no valid mirrors: /var/cache/yum/base/mirrorlist.txt
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again分析一般有三种原因:
1.有可能是防火墙阻碍了出网http请求或是ftp请求,service iptables status2.有可能是dns不对,无法正常解析,换成8.8.8.83.系统取不到Release号
测试环境时使用ping www.baidu.com 显示可以ping通,说明DNS没有问题,那可能就是第三中原因了需要修改*.repo源文件中将$releasever变量全替换成6即可正常yum了vim/etc/yum.repos.d/CentOS6-Base-163.repo【[base]
name=CentOS-6 – Base – 163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-6 – Updates – 163.com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-6 – Extras – 163.com
baseurl=http://mirrors.163.com/centos/6/extr开发云主机域名as/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 – Plus – 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib – packages by Centos Users
[contrib]
name=CentOS-6 – Contrib – 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gp
gkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6】最后更新缓存:yum makecache

相关推荐: 非常实用的冷门APP合集,小众但却逆天好用!

现在有很多好用的app,虽然不被大家熟知,但是功能是非常好用的。那么到底有哪些不被大家熟知的冷门但却好用的app呢?小编在这里给大家分享几个,各方面都有哦,欢迎补充!袋鼠输入推荐理由:懒人必备,可以同区域网内关闭电脑或重启,支持手机控制视频进度与PPT或者也可…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 05/06 11:31
下一篇 05/06 11:31