redhat 7.3 搭建網易163yum源

用網易的yum源來更新挺方便node

1.刪除redhat 原有的yumpython

rpm -aq|grep yum|xargs rpm -e --nodeps

2.下載yum 安裝文件vim

因爲使用wget失敗,因此我直接去網站上點擊下載的,訪問:http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/,會看到全部的包centos

須要下載的有:緩存

/////////////////////////x86_64/////////////////////////////////

wget -c http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm

wget -c http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm

wget -c http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

wget -c http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm

3.安裝yum 軟件包bash

(1)rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm
(2)rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
(3) 兩個一塊兒安裝前後順序不要亂(中間50%正常)
rpm -ivh yum-3.4.3-150.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm

四、更改yum源 #咱們使用網易的CentOS鏡像源服務器

(1)清空yum倉庫測試

cd /etc/yum.repos.d/
rm -rf *

(2)設置源網站

wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
vi CentOS7-Base-163.repo

編輯文件,把文件裏面全部的$releasever所有替換爲你得版本號,即7.3.1611 最後保存!或者直接把下面的內存拷貝到CentOS7-Base-163.repo文件中便可(已經修改好)url

[base]
name=CentOS-7.3.1611 - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/7.3.1611/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-7.3 - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/7.3.1611/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-7.3 - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/7.3.1611/extras/x86_64/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-7.3 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7.3.1611/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

五、清理yum緩存

yum clean all
yum makecache #將服務器上的軟件包信息緩存到本地,以提升搜索安裝軟件的速度
yum install vim* #測試域名是否可用

至此,redhat7.3能夠使用CentOS的yum源在線安裝軟件了!

6.使用 # yum update或 # yum upgrade 升級系統

yum update
# 升級全部包,改變軟件設置和系統設置,系統版本內核都升級
yum -y upgrade
# 升級全部包,不改變軟件設置和系統設置,系統版本升級,內核不改變
相關文章
相關標籤/搜索