CentOS7 加阿里yum源


CentOS系统更换软件安装源

第一步:备份原镜像文件,以免出错后可以恢复。
cp -r /etc/yum.repos.d/ /etc/yum.repos.d.bak/
第二步:下载新的CentOS-Base.repo 到/etc/yum.repos.d/
curl -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo(可能不好用)
第三步:运行yum makecache生成缓存
yum clean all
yum makecache
 
阿里云epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
 
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0
 
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0

  

posted @ 2022-12-03 17:38  z醉清风  阅读(143)  评论(0编辑  收藏  举报