阿里镜像官方地址http://mirrors.aliyun.com/

1、点击官方提供的相应系统的帮助 :
CentOS7设置阿里镜像教程
2、查看不同版本的系统操作:
CentOS7设置阿里镜像教程

为linux系统下载源设置阿里镜像的步骤 :

1. 备份

备份Centos7系统自带的yum源配置文件(/etc/yum.repos.d/CentOS-Base.repo)

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
或:
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2. 下载阿里云yum源文件

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

3. 更改CentOS-Base.repo

更改阿里云的yum源文件,将所有http更改为https,不改有的镜像下不下来

 vim /etc/yum.repos.d/CentOS-Base.repo

CentOS7设置阿里镜像教程

 

 

 

4. 更新现有镜像源

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

5. 更新yum

yum update

6.补充:为yum配置代理,(可以不配置)

在/etc/yum.conf中添加:

proxy=http://192.168.2.56:8080
proxy_username=hanzhc
proxy_password=19920104Caishuang 


参考:https://blog.csdn.net/Steven19920104/article/details/9316

相关文章:

  • 2022-12-23
  • 2021-11-25
  • 2021-10-16
  • 2021-08-06
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
猜你喜欢
  • 2022-01-31
  • 2021-11-09
  • 2022-12-23
  • 2022-02-07
  • 2021-12-14
  • 2022-02-11
  • 2021-11-05
相关资源
相似解决方案