Linux 安裝 YUM《2017最新鏈接》 以及遠程倉

系統:readhat   6.2  linux


1、確認RedHat的版本


cat /etc/redhat-release

uname -m


我的是  x86_64


2、在這裏手工找rpm包:http://mirrors.163.com/centos/


系統6.2,按裏面的readme,使用6.0,進入6.0目錄,是x86_64,因此依次進入以下目錄:os/x86_64/Packages/


找以下幾份文件下載:

在RedHat 6.2中安裝yum並添加163源 - billow - Billow


這裏版本必須一致 我嘗試過修改一個版本的包,然後全部報錯

3、卸載原自帶的yum:
rpm -aq|grep yum|xargs rpm -e --nodeps

4、安裝yum軟件,按以下順序:

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

注意:最後兩個安裝包要放在一起同時安裝,否則會提示相互依賴,安裝失敗。

5、添加最新的yum源《網上163的 早不能用了  現在這纔是Centos官網最新的地址   http://vault.centos.org/6.4/os



# cd /etc/yum.repos.d/
# vim MY.repo

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


#released updates 
[updates]
name=CentOS-6.5 - Updates - 163.com
baseurl=http://vault.centos.org/6.4/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://vault.centos.org/6.4/os/x86_64/RPM-GPG-KEY-CentOS-6


#additional packages that may be useful
[extras]
name=CentOS-6.5 - Extras - 163.com
baseurl=http://vault.centos.org/6.4/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://vault.centos.org/6.4/os/x86_64/RPM-GPG-KEY-CentOS-6


#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.5 - Plus - 163.com
baseurl=http://vault.centos.org/6.4/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://vault.centos.org/6.4/os/x86_64/RPM-GPG-KEY-CentOS-6


#contrib - packages by Centos Users
[contrib]
name=CentOS-6.4 - Contrib - 163.com
baseurl=http://vault.centos.org/6.4/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://vault.centos.org/6.4/os/x86_64/RPM-GPG-KEY-CentOS-6
# vi CentOS6-Base-163.repo
  編輯文件,把文件裏面的$releasever全部替換爲版本號,即6 最後保存!

網頁上下載地址:http://mirrors.163.com/centos/6/os/x86_64/Packages/  和文件內寫的字段一樣 看清楚!

6、導入key
# rpm --import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
7、清理yum緩存
# yum clean all
# yum makecache     #將服務器上的軟件包信息緩存到本地,以提高搜索安裝軟件的速度
# yum install vim*    #測試yum是否可用
  至此,Redhat6可以使用CentOS的yum源在線安裝軟件了!
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章