RHEL配置Centos yum源的方法

由于RHEL的yum在線更新是收費的,如果沒有注冊的話是不能使用的,即不能在線安裝軟件。在這種情況下,如果我們使用的機器安裝的是RHEL系統(tǒng)要是每次安裝軟件先掛載本地光盤會很繁瑣,而且有些軟件也是老版本的,這種情況下我們可以借助CentOS的YUM源來滿足我們的需求。
一、刪除RHEL原有的YUM
rpm -aq|grep yum|xargs rpm -e --nodeps
二、下載CentOS的yum安裝包(163源)
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
三、安裝CentOS的YUM安裝包
yum和yum-plugin-fastestmirror需要一起安裝,這兩個包存在依賴關(guān)系,分開安裝會失敗,安裝之前先把RPM-GPG-KEY導(dǎo)入系統(tǒng),否則會出現(xiàn)警告信息
rpm -ivh yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
rpm --import RPM-GPG-KEY-CentOS-5
rpm –ivh yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rm
至此我們就可以在線使用yum了
四、修改yum源
為了使用在線使用Yum安裝軟件更快,我們可以使用國內(nèi)的網(wǎng)易Yum源或者其他國內(nèi)yum源
五、更改yum源
#我們使用網(wǎng)易的CentOS鏡像源
cd /etc/yum.repos.d/
vi rhel-debuginfo.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-5 - Base - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/5/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-5 - Updates - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=addons
baseurl=http://mirrors.163.com/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus
baseurl=http://mirrors.163.com/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=contrib
baseurl=http://mirrors.163.com/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
六、清理
yum clean all
yum makecache
七、更新
yum update
相關(guān)文章
RHEL系統(tǒng)恢復(fù)安裝光盤中的yum更新源的方法
這篇文章主要介紹了RHEL系統(tǒng)恢復(fù)安裝光盤中的yum更新源的方法,文中的示例環(huán)境為RHEL6.1,同時同為RedHat系的CentOS6.1中的做法也類似,需要的朋友可以參考下2016-04-12在RHEL系統(tǒng)中使用CentOS的yum源的方法
這篇文章主要介紹了在RHEL系統(tǒng)中使用CentOS的yum源的方法,同樣也適用于Fedora等Linux系統(tǒng),需要的朋友可以參考下2015-07-08- Centos默認(rèn)安裝如果是英文的話,選擇中文不正常,firefox也只能見到方塊的字.但有一個方法,其實很容易解決安裝這二個包,然后你就可以見到中文啦.為了這個問題,我可是研究2008-09-18
- 今天小編為大家?guī)淼氖荂entOS下通過yum查找并安裝包的方法,希望可以幫助到大家,有需要的朋友一起去看看吧2016-12-23
- 今天小編為大家?guī)淼氖莄entos yum只更新安全補丁操作;希望可以幫助到大家;有需要的朋友可以過來看看2016-12-11
- 很多朋友還不知道CentOS中如何自定義yum倉庫和配置文件;下面小編就為大家?guī)鞢entOS中自定義yum倉庫和配置文件的方法;有需要的朋友一起去看看吧2016-12-08
Centos yum源更換為國內(nèi)的阿里云鏡像源的方法
這篇文章主要介紹了Centos yum源更換為國內(nèi)的阿里云鏡像源的方法,需要的朋友可以參考下2016-10-08在CentOS系統(tǒng)中通過yum安裝VLC播放器的教程
這篇文章主要介紹了在CentOS系統(tǒng)中通過yum安裝VLC播放器的教程,VLC是Linux系統(tǒng)中人氣最高的視頻播放器,其自帶的解碼器也擁有眾多用戶在使用,需要的朋友可以參考下2016-04-11- 這篇文章主要介紹了CentOS下yum軟件包管理器的基本使用,包括yum軟件倉庫的搭建方法,需要的朋友可以參考下2015-11-30
- centos系統(tǒng)怎么查看軟件安裝路徑?Linux系統(tǒng)一般都是命令行界面,對于安裝的軟件也是通過命令安裝的。對于軟件包更新和卸載等有時候需要查看檢查是否有改軟件,軟件安裝存2015-07-20