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
相關文章
相關標籤/搜索