CentOS7.X更新yum源

对于新装的系统,最好更新一下yum源,不然有的软件用yum命令安装不上,因为该软件不在默认的源中。

1.备份原来的yum源

# cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo-backup

2.设置aliyun的yum源

# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.添加EPEL源

# wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo

4.清理缓存,生成新缓存,执行yum系统更新

# yum clean all

# yum makecache

# yum update(可选)

posted @ 2020-04-07 08:55  依剑倾心  阅读(360)  评论(0编辑  收藏  举报