镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

file

1.先查看本机的系统信息

  1. [root@h0436 h0436 zlong]# cat /etc/redhat-release

2.进入yum.repos.d

  1. [root@h0436 zlong]# cd /etc/yum.repos.d

3.查看镜像文件(看看你需要修改的哪个文件)

  1. [root@h0436 yum.repos.d]# ls
  2. CentOS-Base.repo CentOS-Base.repo.bak epel.repo
  3. CentOS-Base.repo.backup docker-ce.repo

4.修改文件(我的是CentOS-Base.repo.backup文件)

  1. [root@h0436 yum.repos.d]# vim CentOS-Base.repo.backup

5.如果你找不到在哪个文件夹,你就每个文件夹都vim 进去看看,找到CentOS-Base.repo就行

file

6.复制下面这一段配置就行,按键盘上“i”编辑,按ESC退出。如果要保存退出就按:wq,如果不保存退出就按:q (图中标红的地方都是改过之后的地方)

  1. [base]
  2. name=CentOS-8 - Base - mirrors.aliyun.com
  3. failovermethod=priority
  4. baseurl=http://mirrors.aliyun.com/centos/8/os/$basearch/
  5. http://mirrors.aliyuncs.com/centos/8/os/$basearch/
  6. http://mirrors.cloud.aliyuncs.com/centos/8/os/$basearch/
  7. gpgcheck=1
  8. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8
  9. #released updates
  10. [updates]
  11. name=CentOS-8 - Updates - mirrors.aliyun.com
  12. failovermethod=priority
  13. baseurl=http://mirrors.aliyun.com/centos/8/updates/$basearch/
  14. http://mirrors.aliyuncs.com/centos/8/updates/$basearch/
  15. http://mirrors.cloud.aliyuncs.com/centos/8/updates/$basearch/
  16. gpgcheck=1
  17. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8
  18. #additional packages that may be useful
  19. [extras]
  20. name=CentOS-8 - Extras - mirrors.aliyun.com
  21. failovermethod=priority
  22. baseurl=http://mirrors.aliyun.com/centos/8/extras/$basearch/
  23. http://mirrors.aliyuncs.com/centos/8/extras/$basearch/
  24. http://mirrors.cloud.aliyuncs.com/centos/8/extras/$basearch/
  25. gpgcheck=1
  26. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8
  27. #additional packages that extend functionality of existing packages
  28. [centosplus]
  29. name=CentOS-8 - Plus - mirrors.aliyun.com
  30. failovermethod=priority
  31. baseurl=http://mirrors.aliyun.com/centos/8/centosplus/$basearch/
  32. http://mirrors.aliyuncs.com/centos/8/centosplus/$basearch/
  33. http://mirrors.cloud.aliyuncs.com/centos/8/centosplus/$basearch/
  34. gpgcheck=1
  35. enabled=0
  36. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8
  37. #contrib - packages by Centos Users
  38. [contrib]
  39. name=CentOS-8 - Contrib - mirrors.aliyun.com
  40. failovermethod=priority
  41. baseurl=http://mirrors.aliyun.com/centos/8/contrib/$basearch/
  42. http://mirrors.aliyuncs.com/centos/8/contrib/$basearch/
  43. http://mirrors.cloud.aliyuncs.com/centos/8/contrib/$basearch/
  44. gpgcheck=1
  45. enabled=0
  46. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8

7.清除缓存

  1. [root@h0436 yum.repos.d]# yum clean all

8.加载缓存

  1. [root@h0436 yum.repos.d]# yum makecache

file

本文转自:https://blog.csdn.net/Along_168163/article/details/124338818

更多相关文章

  1. AndroidManifest.xml文件详解(uses-sdk)
  2. android上传图片(同步上传)
  3. Android(安卓)退出程序方式——再按一次退出
  4. android ftp案例分析
  5. android退出activity提示再按一次返回键
  6. android中Activity实现再按一次退出
  7. AndroidManifest.xml文件详解(uses-sdk)
  8. android如何获取SD卡上的多媒体文件
  9. Android的一些积累(不断更新)

随机推荐

  1. android双击事件
  2. 三款Android游戏源码
  3. Android shape 参数
  4. Android定义宽高比控件
  5. Android NDK Tools 下载链接大全
  6. android常用权限
  7. Eclipse adt Android Test Project
  8. Android Wear - App Structure for Andro
  9. android 加密字符串
  10. Android WebView对https无响应