JavaScript must be enabled in order for you to see "WP Copy Data Protect" effect. However, it seems JavaScript is either disabled or not supported by your browser. To see full result of "WP Copy Data Protector", enable JavaScript by changing your browser options, then try again.

RHEL使用CentOS的YUM


最近在研究關於RHCSARHCECertification資訊,雖然可以用CentOS來實作Lab,但難免還是會想用RHEL來實作一次,不過對於我們這種窮IT攻城師來說,沒辦法負擔他們技術Support的費用,只好用點小聰明來借用CentOS的資源,所以建議不要在正式機器上使用此招,以免會觸及違反版權無法受到Support的結果,廢話不多說,步驟如下:
#yum list
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
...

I.For CentOS 5 x86

1) 移除RH內建的yum套件
#rpm -qa | grep yum | xargs rpm -e --nodeps

2) 下載並安裝CentOS的rpm套件包
#wget http://mirror01.idc.hinet.net/centos/5.8/os/i386/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
#wget http://mirror01.idc.hinet.net/centos/5.8/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
#wget http://mirror01.idc.hinet.net/centos/5.8/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
#rpm -ivh yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
#rpm -ivh --nodeps yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
#rpm -ivh yum-3.2.22-39.el5.centos.noarch.rpm

3) 將原本RH的更新來源檔案更名,並用CentOS的作替代(Mirror為Hinet IDC)
#wget http://iori.tw/CentOS_5_Mirror_Hinet.tar
#tar zxvf CentOS_5_Mirror_Hinet.tar.gz
#cd /etc/yum.repos.d/
#rename repo repo_bk r*
#mv ~/CentOS_5_Mirror_Hinet/CentOS-Base.repo .

4) 將Mirror.txt放置至yum的Cache目錄內(先執行一次yum list是為了產生Cache目錄內的內容)
#yum list
#mkdir -p /var/cache/yum/{base,extras,updates}/
#cp ~/CentOS_5_Mirror_Hinet/mirrorlist.txt /var/cache/yum/base/
#cp ~/CentOS_5_Mirror_Hinet/mirrorlist.txt /var/cache/yum/extras/
#cp ~/CentOS_5_Mirror_Hinet/mirrorlist.txt /var/cache/yum/updates/

5) 將RPM的GPG金鑰放置至/etc/pki/rpm-gpg目錄內(安裝時會用到,否則無法安裝套件)
#mv ~/CentOS_5_Mirror_Hinet/RPM-GPG-KEY-CentOS-5 /etc/pki/rpm-gpg/
#yum list

6) 透過epel的RPM套件包來做擴充(可增加套件庫的數量)
#wget http://mirror01.idc.hinet.net/epel/5/i386/epel-release-5-4.noarch.rpm
#rpm -ivh epel-release-5-4.noarch.rpm

II.For CentOS 6 x86

1) 移除RH內建的yum套件
#rpm -qa | grep yum | xargs rpm -e --nodeps

2) 下載並安裝CentOS的rpm套件包
#wget http://mirror01.idc.hinet.net/CentOS/6.3/os/i386/Packages/yum-3.2.29-30.el6.centos.noarch.rpm
#wget http://mirror01.idc.hinet.net/CentOS/6.3/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
#wget http://mirror01.idc.hinet.net/CentOS/6.3/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
#rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm
#rpm -ivh --nodeps yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
#rpm -ivh yum-3.2.29-30.el6.centos.noarch.rpm

3) 將原本RH的更新來源檔案更名,並用CentOS的作替代(Mirror為Hinet IDC)
#wget http://iori.tw/CentOS_6_Mirror_Hinet.tar.gz
#tar zxvf CentOS_6_Mirror_Hinet.tar
#cd /etc/yum.repos.d/
#mv rhel-source.repo rhel-source.repo_bk
#mv ~/CentOS_6_Mirror_Hinet/CentOS-Base.repo .

4) 將Mirror.txt放置至yum的Cache目錄內(先執行一次yum list是為了產生Cache目錄內的內容)
#yum list
#mkdir -p /var/cache/yum/i386/\$releasever/{base,extras,updates}/
#cp ~/CentOS_6_Mirror_Hinet/mirrorlist.txt /var/cache/yum/i386/\$releasever/base/
#cp ~/CentOS_6_Mirror_Hinet/mirrorlist.txt /var/cache/yum/i386/\$releasever/extras/
#cp ~/CentOS_6_Mirror_Hinet/mirrorlist.txt /var/cache/yum/i386/\$releasever/updates/

5) 將RPM的GPG金鑰放置至/etc/pki/rpm-gpg目錄內(安裝時會用到,否則無法安裝套件)
#mv ~/CentOS_6_Mirror_Hinet/RPM-GPG-KEY-CentOS-6 /etc/pki/rpm-gpg/
#yum list

6) 透過epel的RPM套件包來做擴充(可增加套件庫的數量)
#wget http://mirror01.idc.hinet.net/epel/6/i386/epel-release-6-7.noarch.rpm
#rpm -ivh epel-release-6-7.noarch.rpm

◎、經過以上的步驟後就可以盡情享用YUM套件庫了,上述的部分均參考RHN更換的CentOS的yum的源,另一種設定方式是直接去修改YUM的來源,可參考這篇文章,不過建議各位看倌們還是用有Support的畢竟比較好,透過憑證來使用的設定可參考紅帽流水誌的介紹,大概先寫到這,累了,收工!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
This site is protected by WP-CopyRightPro