Centos7配置阿里云镜像源的教程

1准备工作,如果不做准备工作后面可能会影响后续的安装。

查看你的Centos版本,版本过低会导致安装失败,验证网络是否可以连接阿里云镜像,使用阿里云是需要网络的。

ping mirrors.aliyun.com

2手动配置

删除原来或者之前的yun源

rm -rf /etc/yum.repos.d/*

2.2 下载阿里云Centos-7.repo文件

# wget命令下载: wget [options] [url] #

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

 

# curl命令下载: curl [options] [url] #

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

2.3 清除及生成缓存

# 清除yum缓存 #

yum clean all

# 缓存阿里云镜像 #

yum makecache

 我上面这个图片由于电脑问题是还没有加载完的

4 进行验证镜像源安装成功没有

yum install lrzsz 

猜你喜欢

转载自blog.csdn.net/lyhshs/article/details/129873566