Linux系统优化yum源
Linux系统优化yum源
一、推荐的yum源:
- 阿里yum源:https://developer.aliyun.com/mirror/centos
- 清华yum源:https://mirrors.tuna.tsinghua.edu.cn/help/centos/
- 网易yum源:http://mirrors.163.com/.help/centos.html
二、以阿里yum源为例进行设置(系统Centos7)
2.1 配置基础的yum源
第一步:备份原有的 CentOS-Base.repo 文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二步:下载阿里提供的 CentOS-Base.repo 文件到 /etc/yum.repos.d/ 目录下
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
2.2 配置扩展的yum源
https://developer.aliyun.com/mirror/epel
第一步:备份(如果配置过其他epel源)
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
第二步:下载阿里提供的epel yun源文件到 /etc/yum.repos.d/ 目录下
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
没有wget命令的需要安装 yum install -y wget
2.3 重建yum缓存
yum clean all
yum makecache
三、代码复制
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y wget
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

浙公网安备 33010602011771号