liunx安装软件报错yum install gcc-c++

 http://ftp.sjtu.edu.cn/centos/6.9/os/x86_64/repodata/repomd.xml: 
[Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" 尝试其他镜像

错误原因是 http://ftp.sjtu.edu.cn/centos/6.9/os/x86_64/repodata/repomd.xml已经变了比如ie浏览器输入http://ftp.sjtu.edu.cn/centos/6.9/os/x86_64/repodata/repomd.xml会爆404.输入.http://ftp.sjtu.edu.cn/centos回车,找到6.9后有个文档readme.text.意思说6系列(6.1;6.2.等)全改为6了。 所以要改配置文件

1: vim /etc/yum.repos.d/CentOS-Base.repo

把baseurl=ftp.sjtu.edu.cn/centos/$releasever/os/中的$releasever换成6

(大概四处baseurl=要换)

2:wq保存

3:yum makecache

4:齐活完事yum install xxxxx

猜你喜欢

转载自blog.csdn.net/Jodl666/article/details/83309073