更新CentOS默认yum源/镜像源为mirrors.aliyun.com
原创
©著作权归作者所有:来自51CTO博客作者CARLOS_KONG的原创作品,请联系作者获取转载授权,否则将追究法律责任
更新CentOS默认yum源/镜像源为mirrors.aliyun.com
1、首先备份系统自带的yum源配置文件 /etc/yum.repos.d/CentOS-Base.repo
在进行此类更改时候,先对系统默认源文件进行备份,备份是一个很好的习惯,此处如果权限不够,就使用root权限
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、进入yum源配置文件所在的文件夹
3、下载aliyun的yum源配置文件到/etc/yum.repos.d/
CentOS 7:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4、运行yum makecache生成缓存
5、更新系统,运行安装rpel源命令,安装完成之后你就可以直接使用yum来安装额外的软件包
yum -y update
yum -install epel-release