首頁  >  文章  >  運維  >  centos7更換國內yum來源

centos7更換國內yum來源

王林
王林轉載
2020-08-03 17:11:209632瀏覽

centos7更換國內yum來源

具體步驟:

(推薦教學:centos教學

1、備份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

mv /etc/yum/repos.d/CentOS-Base.repo{,.date -I}

2、下載新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

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


curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

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

CentOS 7

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

(影片教學推薦:linux影片教學

3、新增EPEL

CentOS 6

wget -O /etc/yum.repos.d/epel-6.repo http://mirrors.aliyun.com/repo/epel-6.repo

CentOS 7

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

4、清理緩存並產生新的快取

yum clean all
yum makecache

完成!

以上是centos7更換國內yum來源的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:linux公社。如有侵權,請聯絡admin@php.cn刪除