最近在下一些软件的时候速度实在太慢,原来是默认的yum源在国外,延迟太高,于是决定改成国内yum源,一起看看吧
一.首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
二.下载ailiyun的yum源配置文件到/etc/yum.repos.d/
查看系统版本
cat /etc/redhat-release
下载对应版本
#各系统版本repo文件对应的下载操作
# CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
如果没有wget命令
yum install wget
三.运行yum makecache生成缓存,提高检索速度
yum clean all
yum makecache