原文:https://blog.csdn.net/ctypyb2002/article/details/80635924
备份原来的yum源
先备份,在任何环境下操作都是个良好习惯
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
设置aliyun的yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
添加EPEL源
官员EPEL源,大家最好还是问下度娘。
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
或者
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh ./epel-release-latest-7.noarch.rpm
清理缓存并生成新的缓存
yum clean all
yum makecache
网友评论