Linux 新机配置yum源

2019-03-15  本文已影响0人  AmenSun

备份原来的镜像

# cd /etc/yum.repos.d/
# ls | xargs -i mv {} ./{}.bak

在CentOS6上配置阿里云的Base源

# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# yum clean all
# yum makecache
# yum repolist

在CentOS7上配置阿里云的Base源

# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# yum clean all
# yum makecache
# yum repolist

配置epel源

Couldn't resolve host 'mirrorlist.centos.org' 错误

# echo "nameserver 8.8.8.8" >>/etc/resolv.conf

手动配置yum源

上一篇 下一篇

猜你喜欢

热点阅读