目 录CONTENT

文章目录

Centos7配置国内源及安装elpe

ashin
2021-12-25 / 0 评论 / 0 点赞 / 999 阅读 / 0 字

由于centos8自带的源速度实在太慢,不得不替换成国内源。

下面是配置阿里源的命令。

1、安装wget,已安装跳过

yum -y install wget

备份原来yum源

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

2、更改默认源为阿里源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
yum -y update

3、安装epel

yum -y install epel-release

4、epel更换阿里源

cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
cp /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
sed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
yum clean all
yum makecache
yum -y update
0

评论区