一、centos7 修改为网易的yum源

1.执行命令:cd /etc/yum.repos.d/
进入yum源配置目录
Centos7系统更换yum源镜像为国内镜像教程

2.执行命令:mv CentOS-Base.repo CentOS-Base.repo.bak备份服务器原有的yum源文件
Centos7系统更换yum源镜像为国内镜像教程
3.下载国内网易的yum源镜像,本文演示系统是Centos7所以下载的是网易的Centos7的yum源
Centos7系统更换yum源镜像为国内镜像教程
Centos7系统更换yum源镜像为国内镜像教程
4.执行命令:mv CentOS6-Base-163.repo CentOS-Base.repo

更换yum源配置文件
Centos7系统更换yum源镜像为国内镜像教程
5.执行命令:yum makecache 生成yum源缓存
Centos7系统更换yum源镜像为国内镜像教程
6.执行命令:yum -y update

更新yum源,等待更新完毕即可。
Centos7系统更换yum源镜像为国内镜像教程


二、centos7 修改为阿里的yum源

  1. 备份本地yum源
 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak 

2.获取阿里yum源配置文件

 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 

3.更新cache

 yum makecache 

4.安装

 yum -y update 

相关文章:

  • 2021-08-08
  • 2021-12-28
  • 2021-12-29
  • 2021-09-13
  • 2021-11-29
  • 2021-12-15
  • 2021-12-08
  • 2021-11-04
猜你喜欢
  • 2021-11-29
  • 2021-11-29
  • 2021-10-08
  • 2021-11-22
  • 2021-11-19
  • 2021-12-15
  • 2021-10-06
  • 2021-11-04
相关资源
相似解决方案