各种笔记
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

25 行
947 B

  1. # CentOS 8 换源,设置dnf / yum镜像
  2. aliyun更新了centos8的说明
  3. 1、备份
  4. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  5. 2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
  6. curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
  7. 3、生成缓存
  8. yum makecache
  9. 4 配置镜像的。
  10. cd /etc/yum.repos.d
  11. #备份
  12. cp CentOS-Base.repo CentOS-Base.repo.bak;
  13. cp CentOS-AppStream.repo CentOS-AppStream.repo.bak;
  14. cp CentOS-Extras.repo CentOS-Extras.repo.bak;
  15. sed -i 's/mirrorlist=/#mirrorlist=/g' CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo;
  16. sed -i 's/#baseurl=/baseurl=/g' CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo;
  17. sed -i 's/http:\/\/mirror.centos.org/https:\/\/mirrors.aliyun.com/g' CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo