Centos7系统更换yum源镜像为国内镜像教程

一、centos7 修改为网易的yum源

1.执行命令:cd /etc/yum.repos.d/
进入yum源配置目录
在这里插入图片描述

2.执行命令:mv CentOS-Base.repo CentOS-Base.repo.bak备份服务器原有的yum源文件
在这里插入图片描述
3.下载国内网易的yum源镜像,本文演示系统是Centos7所以下载的是网易的Centos7的yum源
在这里插入图片描述
在这里插入图片描述
4.执行命令:mv CentOS6-Base-163.repo CentOS-Base.repo

更换yum源配置文件
在这里插入图片描述
5.执行命令:yum makecache 生成yum源缓存
在这里插入图片描述
6.执行命令:yum -y update

更新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 

猜你喜欢

转载自blog.csdn.net/BigData_Mining/article/details/88568336