CentOS7系統更換YUM Repo源

CentOS7系統更換YUM Repo源

備份原鏡像

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

下載阿里雲的Base源和EPEL源

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

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

或者 下載騰訊雲的Base源和EPEL源

  sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo

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

或者 下載163的Base源

  sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

清理和生成緩存

  sudo yum clean all
sudo yum makecache

END

相關文章
相關標籤/搜索