CentOS7更换镜像源

1)先安装wget
执行命令 yum install -y wget

[root@localhost ~]# yum install -y wget
  1. 查询国内镜像源

打开阿里镜像http://mirrors.aliyun.com/

这里写图片描述
点击帮助:
这里写图片描述
3)下载CentOS 7的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

4)更新镜像源

#清除缓存
yum clean all  
#生成缓存
yum makecache
[root@localhost ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@localhost ~]# yum makecache
Loaded plugins: fastestmirror
base                                                                                                                                                                  | 3.6 kB  00:00:00     
extras                                                                                                                                                                | 3.4 kB  00:00:00     
updates                                                                                                                                                               | 3.4 kB  00:00:00     
(1/12): base/7/x86_64/group_gz                                                                                                                                        | 155 kB  00:00:00     
(2/12): extras/7/x86_64/filelists_db                                                                                                                                  | 770 kB  00:00:02     
(3/12): extras/7/x86_64/primary_db                                                                                                                                    | 151 kB  00:00:00     
(4/12): extras/7/x86_64/other_db                                                                                                                                      | 640 kB  00:00:07     
(5/12): updates/7/x86_64/filelists_db 
.......省略
  • 6
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大痴小乙

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值