centos配置yum数据源

国内数据源地址

阿里:https://developer.aliyun.com/mirror/
中国互联网络信息中心:https://mirrors.cnnic.cn/

配置镜像的步骤

配置阿里镜像(yum,epel)

配置yum

  • 备份CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  • 下载需要的CentOS-Base.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  • 处理缓存
yum clean all # 清除所有的yum缓存
yum makecache # 生成yum缓存

图示yum执行步骤

在这里插入图片描述
在这里插入图片描述

配置epel

备份(如有配置其他epel源)

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

下载新repo 到/etc/yum.repos.d/

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

缓存配置

yum clean all # 清除yum缓存
yum makecache # 生成yum缓存

图示epel安装步骤

在这里插入图片描述

查看配置结果

yum repolist all # 查看所有yum
yum repolist enabled # 查看可用的yum

在官方查找对应的配置步骤

阿里

开发者社区:https://developer.aliyun.com/mirror/
在开发者社区可以找到你需要的各种配置在这里插入图片描述
点击 centos 就可以看到官方的配置方式
在这里插入图片描述

中国互联网络信息中心

网址:https://mirrors.cnnic.cn/
点击 ?可以找到具体的配置办法
在这里插入图片描述
点击 ? 之后就可以找到你需要的配置步骤
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章