CentOS7更换镜像源

拼搏现实的明天。 2022-05-26 04:18 342阅读 0赞

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

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

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

这里写图片描述
点击帮助:
这里写图片描述
3)下载CentOS 7的repo文件

  1. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  2. #或者
  3. curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

4)更新镜像源

  1. #清除缓存
  2. yum clean all
  3. #生成缓存
  4. yum makecache
  5. [root@localhost ~]# yum clean all
  6. Loaded plugins: fastestmirror
  7. Cleaning repos: base extras updates
  8. Cleaning up everything
  9. Cleaning up list of fastest mirrors
  10. [root@localhost ~]# yum makecache
  11. Loaded plugins: fastestmirror
  12. base | 3.6 kB 00:00:00
  13. extras | 3.4 kB 00:00:00
  14. updates | 3.4 kB 00:00:00
  15. (1/12): base/7/x86_64/group_gz | 155 kB 00:00:00
  16. (2/12): extras/7/x86_64/filelists_db | 770 kB 00:00:02
  17. (3/12): extras/7/x86_64/primary_db | 151 kB 00:00:00
  18. (4/12): extras/7/x86_64/other_db | 640 kB 00:00:07
  19. (5/12): updates/7/x86_64/filelists_db
  20. .......省略

发表评论

表情:
评论列表 (有 0 条评论,342人围观)

还没有评论,来说两句吧...

相关阅读

    相关 CentOS7更换yum镜像

    目录 •写在前面 •具体步骤 -------------------- •写在前面 更换镜像源的理由总是惊人的相似,都是因为访问国外的网速不好,所以我们选择更换成

    相关 Centos7 更换yum

    背景   Centos 7默认的yum源网络不好使,所以更改yum源为阿里云 解决方案          命令,可选两种方式均可以,此种命令更换源为阿里云    一