在CentOS上添加软件源
本节示例步骤使用的操作系统为CentOS 7
运行以下命令备份原软件源
[root@wmcentos7 ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
运行以下任一命令添加CentOS 7软件源
[root@wmcentos7 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
运行以下命令生成本地缓存,加快搜索、安装软件的速度
[root@wmcentos7 ~]# yum clean all && yum makecache
查看软件源是否添加成功
[root@wmcentos7 ~]# yum repolist