配置yum源的步骤(阿里源)

时间:2024-02-19 18:15:47

配置yum源的步骤
1.可以移除默认的yum仓库,也就是删除 /etc/yum.repos.d/底下所有的.repo文件(踢出国外的yum源)

 

1.配置yum源,找到阿里云的官方镜像源地址 https://opsx.alibaba.com/mirror
2.下载centos7的yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.清空旧的yum缓存
yum clean all
4.生成新的yum仓库缓存(这个缓存来自于阿里云的yum仓库,便于加速软件下载)
yum makecache
5.配置一个第三方的 额外仓库源 (epel源),这个源的作用是,如果阿里云源找不到这个软件,就在这里找
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo