Yellow dog Updater(Yum)是CentOS所有版本的默认包管理器,yum主要功能是更方便的添加/删除/更新RPM包,自动解决包的依赖性问题,便于管理大量系统的更新问题,其理念是使用一个中心仓库(repository)管理一部分甚至一个distribution的应用程序相互关系,根据计算出来的软件依赖关系进行相关的升级、安装、删除等操作,减少了Linux用户一直头痛的dependencies的问题。可以同时配置多个资源库(Repository),简洁的配置文件(/etc/yum.conf),自动解决增加或删除rpm包时遇到的依赖性问题,保持与RPM数据库的一致性。
我们现在把CentOS 7.5的默认yum源更换为国内的阿里云yum源,让下载安装及更新速度更快一些,替换很简单,简单记录一下步骤。
1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
或
mv /etc/yum/repos.d/CentOS-Base.repo{,.date -I}
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5 wget -O /etc/yum.repos.d/CentOS-Base.repo mirrors.aliyun.com/repo/Centos… 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo mirrors.aliyun.com/repo/Centos…
CentOS 6 wget -O /etc/yum.repos.d/CentOS-Base.repo mirrors.aliyun.com/repo/Centos… 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo mirrors.aliyun.com/repo/Centos…
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo mirrors.aliyun.com/repo/Centos…
或
curl -o /etc/yum.repos.d/CentOS-Base.repo mirrors.aliyun.com/repo/Centos…
3、添加EPEL
CentOS 6
wget -O /etc/yum.repos.d/epel-6.repo mirrors.aliyun.com/repo/epel-6…
CentOS 7
wget -O /etc/yum.repos.d/epel.repo mirrors.aliyun.com/repo/epel-7… 4、清理缓存并生成新的缓存
yum clean all
yum makecache