【小知識】Centos7更換yum源

  • 備份系統自帶源

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

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

CentOS 5curl

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

或者url

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

CentOS 6get

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.repoyum

CentOS 7developer

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 makecache生成緩存

備註:源文章來源阿里雲開發者社區https://developer.aliyun.com/...

相關文章
相關標籤/搜索