RHELがCentos yumソースを構成する方法
RHELのyumオンライン更新は有料なので、登録していないと使えない、つまりオンラインインストールソフトができない。この場合、我々が使用している機器がRHELシステムをインストールしている場合、ソフトウェアをインストールするたびにローカルディスクをマウントするのは煩雑であり、一部のソフトウェアも古いバージョンである場合、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は一緒にインストールする必要があります。この2つのパッケージは依存関係があり、別々にインストールすると失敗します。インストールする前にRPM-GPG-KEYをシステムにインポートしてください。そうしないと警告メッセージが表示されます。
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インストールソフトウェアをより速く使用するために、国内の網易Yumソースまたはその他の国内yumソースを使用することができます。
五、yumソースの変更#網易の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