Yum简介
yum (全称为 Yellow dogUpdater,modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐的一次次下载安装。
1.备份或删除官方Yum库
mv /etc/yum.repos.d/* /tmp/
//将官方源移动到/tmp/目录下
2.下载阿里yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
//下载阿里yum源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
//扩展包
3.更新Yum仓库
yum makecache
//更新yum仓库
4.验证yum源
[root@localhost ~]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
源标识 源名称 状态
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,097
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,195
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 323
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 1,475
repolist: 25,090
//我们可以看出已经换成aliyun
5.实验安装httpd
root@localhost ~]# yum -y install httpd
//实验成功 yum源配置完毕
centos7配置阿里yum源到这里就结束了,感谢大家观看,可能有内容不详细或者不准确,欢迎大家指出,评论。再次感谢大家的支持与观看!