找回密码
 免费注册

[Linux] CentOS7如何更换yum源和如何使用yum安装和卸载软件

[复制链接]
admin 发表于 2024-3-24 13:20:22 | 显示全部楼层 |阅读模式
首先我们先对系统本身的yum源进行备份
  1. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
复制代码

下载国内yum源配置文件到/etc/yum.repos.d/CentOS-Base.repo
  1. 阿里云 CentOS 7 源(推荐):
  2. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

  3. 网易163 CentOS 7 源:
  4. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

  5. 搜狐 CentOS 7 源:
  6. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.sohu.com/help/CentOS7-Base-sohu.repo

  7. 华为云 CentOS 7 源:
  8. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.myhuaweicloud.com/repo/CentOS-7.repo

  9. 华东理工大学 CentOS 7 源:
  10. wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.ustc.edu.cn/centos/7/os/x86_64

  11. 清华大学 CentOS 7 源:
  12. wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/

  13. 北京理工大学 CentOS 7 源:
  14. wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.bfsu.edu.cn/centos/7/os/x86_64/

  15. 上海交通大学 CentOS 7 源:
  16. wget -O /etc/yum.repos.d/CentOS-Base.repo https://ftp.sjtu.edu.cn/centos/7/os/x86_64/

  17. 中国科学技术大学 CentOS 7 源:
  18. wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.ustc.edu.cn/centos/7/os/x86_64/

  19. 兰州大学 CentOS 7 源:
  20. wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirror.lzu.edu.cn/centos/7/os/x86_64/
复制代码

清理yum缓存,并生成新的缓存
  1. yum clean all
  2. yum makecache
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|Archiver|手机版|小黑屋|信息共享网

GMT+8, 2024-5-15 12:38 , Processed in 0.065609 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表