RHEL6.5系統更換Centos系統YUM源

來源:互聯網
上載者:User

標籤:rhel系統使用centosyum源

##引言##:由於RHEL的yum線上更新是收費的,如果沒有註冊的話是不能使用的,即不能線上安裝軟體。那麼要想用yum線上安裝軟體我們可以使用centos的yum源,具體辦法見下面內容。

一、刪除RHEL原有的yum

[[email protected] ~]# rpm -aq|grep yum|xargs rpm -e --nodeps    ##刪除

二、下載centos的yum安裝包

[[email protected] ~]# wget http://vault.centos.org/6.0/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

[[email protected] ~]# wget http://vault.centos.org/6.0/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm

[[email protected] ~]# wget http://vault.centos.org/6.0/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm

[[email protected] ~]# wget http://vault.centos.org/6.0/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm

三、安裝yum軟體包

[[email protected] ~]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm 

[[email protected] ~]# rpm -ivh  yum-metadata-parser-1.1.2-14.1.el6.i686.rpm

####注意下面這兩個軟體包必須一起安裝####

[[email protected] ~]# rpm -ivh yum-3.2.27-14.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm 

四、更改本地yum源,使用網易的Centos,yum源

[[email protected] ~]# cd /etc/yum.repos.d/    ##切換到yum源配置目錄

####下載網易yum源

[[email protected] yum.repos.d]# wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo

[[email protected] yum.repos.d]# vi CentOS6-Base-163.repo     ##使用vi編輯yum設定檔將檔案中$releasever的替換成6。在末行模式執行此命令括弧中的命令(:% s/$releasever/6/g)共替換15處。

五、清除yum緩衝

[[email protected] yum.repos.d]# yum clean all  ##清除緩衝

[[email protected] yum.repos.d]# yum makecache  ##將伺服器上的軟體包緩衝到本地

[[email protected] yum.repos.d]# yum -y install httpd    ##測試安裝httpd服務

Loaded plugins: fastestmirror, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile

Setting up Install Process

Resolving Dependencies

--> Running transaction check

--> Processing Dependency: httpd = 2.2.15-29.el6_4 for package: httpd-devel-2.2.15-29.el6_4.x86_64

---> Package httpd.x86_64 0:2.2.15-39.el6.centos set to be updated

--> Processing Dependency: httpd-tools = 2.2.15-39.el6.centos for package: httpd-2.2.15-39.el6.centos.x86_64

--> Running transaction check

---> Package httpd-devel.x86_64 0:2.2.15-39.el6.centos set to be updated

---> Package httpd-tools.x86_64 0:2.2.15-39.el6.centos set to be updated

--> Finished Dependency Resolution


Dependencies Resolved


======================================================================================================================================

 Package                         Arch                       Version                                    Repository                Size

======================================================================================================================================

Updating:

 httpd                           x86_64                     2.2.15-39.el6.centos                       base                     825 k

Updating for dependencies:

 httpd-devel                     x86_64                     2.2.15-39.el6.centos                       base                     152 k

 httpd-tools                     x86_64                     2.2.15-39.el6.centos                       base                      75 k


Transaction Summary

======================================================================================================================================

Install       0 Package(s)

Upgrade       3 Package(s)


Total download size: 1.0 M

Downloading Packages:

(1/3): httpd-2.2.15-39.el6.centos.x86_64.rpm                                                                   | 825 kB     00:02     

(2/3): httpd-devel-2.2.15-39.el6.centos.x86_64.rpm                                                             | 152 kB     00:00     

(3/3): httpd-tools-2.2.15-39.el6.centos.x86_64.rpm                                                             |  75 kB     00:00     

--------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                 277 kB/s | 1.0 MB     00:03     

warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

base/gpgkey                                                                                                    | 3.3 kB     00:00 ... 

Importing GPG key 0xC105B9DE "CentOS-6 Key (CentOS 6 Official Signing Key) <[email protected]>" from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

PackageKit-0.5.8-21.el6.x86_64 has missing requires of PackageKit-yum = (‘0‘, ‘0.5.8‘, ‘21.el6‘)

PackageKit-0.5.8-21.el6.x86_64 has missing requires of PackageKit-yum-plugin = (‘0‘, ‘0.5.8‘, ‘21.el6‘)

rhn-check-1.0.0.1-16.el6.noarch has missing requires of yum-rhn-plugin >= (‘0‘, ‘0.9.1‘, ‘35‘)

  Updating       : httpd-tools-2.2.15-39.el6.centos.x86_64                                                                        1/6 

  Updating       : httpd-2.2.15-39.el6.centos.x86_64                                                                              2/6 

  Updating       : httpd-devel-2.2.15-39.el6.centos.x86_64                                                                        3/6 

  Cleanup        : httpd-devel-2.2.15-29.el6_4.x86_64                                                                             4/6 

  Cleanup        : httpd-2.2.15-29.el6_4.x86_64                                                                                   5/6 

  Cleanup        : httpd-tools-2.2.15-29.el6_4.x86_64                                                                             6/6 


Updated:

  httpd.x86_64 0:2.2.15-39.el6.centos                                                                                                 


Dependency Updated:

  httpd-devel.x86_64 0:2.2.15-39.el6.centos                         httpd-tools.x86_64 0:2.2.15-39.el6.centos                        


Complete!


#########至此RHEL的yum就更改為Centos的yum源##########




本文出自 “Linux” 部落格,請務必保留此出處http://wangenzhi.blog.51cto.com/9214174/1671110

RHEL6.5系統更換Centos系統YUM源

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.