CentOS 7-软件的镜像设置

一、软件的镜像网址
1. 设置阿里镜像

阿里云镜像网址:https://developer.aliyun.com/mirror/
在这里插入图片描述点击对应系统,按照步骤配置即可。
在这里插入图片描述
具体操作,有网环境:

  • 安装wget
yum -y install wget
  • 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  • 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

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

CentOS 8

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo`

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
  • 清理缓存
yum clean all
  • 重新生成缓存
yum makecache
2. 设置网易镜像

镜像设置参考地址:http://mirrors.163.com/.help/centos.html
网易提供的是配置文件,有网直接使用wget下载对用的配置文件到对应的目录即可。
后续操作跟阿里云一致。
截止目前网易只有5,6,7的镜像配置。

3. 设置清华大学开源软件镜像

镜像设置参考地址:https://mirrors.tuna.tsinghua.edu.cn/help/centos/

  • 备份
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
  • 更改配置
    编辑 /etc/yum.repos.d/CentOS-Base.repo 文件,在 mirrorlist= 开头行前面加 # 注释掉;并将 baseurl= 开头行取消注释(如果被注释的话),把该行内的域名(例如mirror.centos.org)替换为 mirrors.tuna.tsinghua.edu.cn。
    或者获取对应版本的配置进行覆盖,但是最好不要,官方都说未经过充分测试。
  • 清空缓存,重新生成即可。
4. 设置中国科大软件镜像

镜像设置参考地址:https://mirrors.ustc.edu.cn/help/centos.html

  • 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  • 下载对应版本的 CentOS-Base.repo , 放入 /etc/yum.repos.d/
  • 清空缓存,重新生成即可。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值