Centos7更改yum源與更新系統

[1] 首先備份vim

/etc/yum.repos.d/CentOS-Base.repo

 

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

 

[2] 進入yum源配置文件所在文件夾緩存

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

 

[3] 下載163的yum源配置文件,放入/etc/yum.repos.d/(操做前請作好相應備份)app

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

 

(CentOS 5

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

 

CentOS 6編輯器

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

 

CentOS 7spa

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

 

[4] 運行yum makecache生成緩存.net

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

 

[5] 更新系統code

[root@localhost yum.repos.d]# yum -y update

 

[6] 安裝vim編輯器blog

[root@localhost ~]# yum -y install vim*

 

 

 

FAQ:進程

  1. yum提示Another app is currently holding the yum lock; waiting for it to exit

能夠經過強制關掉yum進程:get

rm -f /var/run/yum.pid
相關文章
相關標籤/搜索