每次使用yum安装的时候总是会出现以下错误
http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-7/x86_64/repodata/repomd.xml:
[Errno 14] curl#7 - "Failed to connect to 2610:28:3090:3001:5054:ff:fea7:9474: Network is unreachable"
初步判断是源的问题,找了下修改yum源的方法,以及展示几个推荐比较多的源
- 备份当前的源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 修改源为ali的源(推荐较多)
wget http://mirrors.aliyun.com/repo/Centos-7.repo
- 清理一下旧包 yum clean all
yum clean all
- 复制到yum的源文件夹,然后修改为默认的源
cp Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo
- 生成缓存
yum makecache
- 但是生成缓存的时候,又出现了之前的错误,根据地址查了下,发现是epel-apache-maven.repo的源被使用了,把它置为不可使用
修改 epel-apache-maven.repo 中的 enabled=1 为 enabled=0
- 重新生成缓存
yum makecache
完成
推荐的几个源(会更新)
[阿里云-centos7] http://mirrors.aliyun.com/repo/Centos-7.repo (使用过的最快的源)
[163] http://mirrors.163.com/.help/CentOS7-Base-163.repo
参考链接 :
https://blog.csdn.net/qq_18831583/article/details/79146759
https://blog.whsir.com/post-296.html