Centos 下更新yum源

最近公司安全策略升级,默认只能通过https,即tcp/443端口访问外网。造成服务器上yum执行命令时,不断超时,总结一下解决方案:

 

cd /etc/yum.repos.d/

rm ./*

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

#继续在/etc/yum.repos.d/文件夹下操作

vim CentOS-Base.repo

:%s/http/https/g

#所有的yum都改为https访问

yum clean all
yum makecache

  

至此,80端口不能访问外网导致yum超时的问题解决。

posted @ 2020-03-12 16:42  练武不练功到头一场空  阅读(241)  评论(0)    收藏  举报