CentOS更改yum源与更新系统

  • VMware版本号:12.0.0缓存

  • CentOS版本:7.0code

1、更换以前确保本身安装wget

[root@localhost ~]# yum list wget

没有安装:get

[root@localhost ~]# yum -y install wget

2、首先备份/etc/yum.repos.d/CentOS-Base.repo

[root@localhost ~]# cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

3、进入yum源配置文件所在文件夹

[root@localhost yum.repos.d]# cd /etc/yum.repos.d/

4、下载163的yum源配置文件,放入/etc/yum.repos.d/(操做前作好相应备份)

[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

5、运行yum makecache生成缓存

[root@localhost yum.repos.d]# yum makecache

6、运行yum makecache生成缓存

[root@localhost yum.repos.d]# yum -y update
相关文章
相关标签/搜索