修改RHEL 6的YUM源
卸载掉RHEL6自带的YUM包。
使用下列命令检查YUM的依赖关系。
rpm -qR yum
得到的依赖关系有:
[root@bogon doc]# rpm -qR yum-3.2.27-14.el6.noarch
/usr/bin/python
config(yum) = 3.2.27-14.el6
pygpgme
python >= 2.4
python(abi) = 2.6
python-iniparse
python-sqlite
python-urlgrabber >= 3.9.0-8
rpm >= 0:4.4.2
rpm-python
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
yum-metadata-parser >= 1.1.0
rpmlib(PayloadIsXz) <= 5.2-1
[root@bogon doc]# rpm -qR yum
/usr/bin/python
config(yum) = 3.2.27-14.el6
pygpgme
python >= 2.4
python(abi) = 2.6
python-iniparse
python-sqlite
python-urlgrabber >= 3.9.0-8
rpm >= 0:4.4.2
rpm-python
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
yum-metadata-parser >= 1.1.0
rpmlib(PayloadIsXz) <= 5.2-1
使用YUM来卸载掉自己。
命令是:
yum erase yum
运行结果是:
[root@bogon doc]# yum erase yum
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package yum.noarch 0:3.2.27-14.el6 set to be erased
--> Processing Dependency: yum >= 3.2.19-15 for package: yum-rhn-plugin-0.9.1-5.el6.noarch
--> Processing Dependency: yum >= 3.2.25-10 for package: yum-utils-1.1.26-11.el6.noarch
--> Running transaction check
---> Package yum-rhn-plugin.noarch 0:0.9.1-5.el6 set to be erased
--> Processing Dependency: yum-rhn-plugin >= 0.5.3-30 for package: rhn-check-1.0.0-38.el6.noarch
---> Package yum-utils.noarch 0:1.1.26-11.el6 set to be erased
--> Processing Dependency: yum-utils for package: abrt-addon-ccpp-1.1.13-4.el6.i686
--> Running transaction check
---> Package abrt-addon-ccpp.i686 0:1.1.13-4.el6 set to be erased
--> Processing Dependency: abrt-addon-ccpp for package: abrt-cli-1.1.13-4.el6.i686
---> Package rhn-check.noarch 0:1.0.0-38.el6 set to be erased
--> Processing Dependency: rhn-check >= 0.0.8 for package: rhnsd-4.9.3-2.el6.i686
--> Running transaction check
---> Package abrt-cli.i686 0:1.1.13-4.el6 set to be erased
---> Package rhnsd.i686 0:4.9.3-2.el6 set to be erased
--> Processing Dependency: rhnsd for package: rhn-setup-1.0.0-38.el6.noarch
--> Running transaction check
---> Package rhn-setup.noarch 0:1.0.0-38.el6 set to be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================
Package Arch Version Repository Size
================================================================================================
Removing:
yum noarch 3.2.27-14.el6 @anaconda-RedHatEnterpriseLinux-201009221732.i386/6.0 3.8 M
Removing for dependencies:
abrt-addon-ccpp
i686 1.1.13-4.el6 @anaconda-RedHatEnterpriseLinux-201009221732.i386/6.0 49 k
abrt-cli i686 1.1.13-4.el6 @anaconda-RedHatEnterpriseLinux-201009221732.i386/6.0 63 k
rhn-check noarch 1.0.0-38.el6 @anaconda-RedHatEnterpriseLinux-201009221732.i386/6.0 38 k
rhn-setup noarch 1.0.0-38.el6 @anaconda-RedHatEnterpriseLinux-201009221732.i386/6.0 190 k
rhnsd i686 4.9.3-2.el6 @anaconda-RedHatEnterpriseLinux-201009221732.i386/6.0 89 k
yum-rhn-plugin
noarch 0.9.1-5.el6 @anaconda-RedHatEnterpriseLinux-201009221732.i386/6.0 174 k
yum-utils noarch 1.1.26-11.el6 @anaconda-RedHatEnterpriseLinux-201009221732.i386/6.0 239 k
Transaction Summary
================================================================================================
Remove 8 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : abrt-cli-1.1.13-4.el6.i686 1/8
Erasing : rhn-check-1.0.0-38.el6.noarch 2/8
Erasing : yum-rhn-plugin-0.9.1-5.el6.noarch 3/8
Erasing : rhn-setup-1.0.0-38.el6.noarch 4/8
Erasing : rhnsd-4.9.3-2.el6.i686 5/8
Erasing : abrt-addon-ccpp-1.1.13-4.el6.i686 6/8
Erasing : yum-utils-1.1.26-11.el6.noarch 7/8
Erasing : yum-3.2.27-14.el6.noarch 8/8
Removed:
yum.noarch 0:3.2.27-14.el6
Dependency Removed:
abrt-addon-ccpp.i686 0:1.1.13-4.el6 abrt-cli.i686 0:1.1.13-4.el6 rhn-check.noarch 0:1.0.0-38.el6 rhn-setup.noarch 0:1.0.0-38.el6
rhnsd.i686 0:4.9.3-2.el6 yum-rhn-plugin.noarch 0:0.9.1-5.el6 yum-utils.noarch 0:1.1.26-11.el6
Complete!
重新安装Centos的YUM包。
然后重新安装Centos6.0的YUM包。
安装YUM需要的RPM包有:
yum-3.2.27-14.el6.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
这两个RPM包的下载地址为:
http://mirrors.163.com/centos/6.0/os/i386/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
http://mirrors.163.com/centos/6.0/os/i386/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
建议将2个RPM包下载到一个单独的文件夹。下载完成后,安装这2个RPM包。
安装命令:
省时间的方式是:
rpm -ivh *.rpm
NB的方式是:
rpm -ivh yum-3.2.27-14.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
小问题:
如果直接安装Centos的YUM包,并修改YUM源后会发现不能够正常的Yum install文件,并提示下列错误:
http://mirrors.163.com/centos/%24releasever/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404 : http://mirrors.163.com/centos/%24releasever/os/i386/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml)
for repository: base. Please verify its path and try again
这是因为没有修改RHEL的发行版本造成的。如果要修正这个问题则需要执行下列命令:
rpm -e --nodeps redhat-release-server-6Server-6.0.0.37.el6.i686 redhat-indexhtml-6-1.el6.noarch
然后下载Centos的release和indexhtml包,安装即可。
wget http://mirrors.163.com/centos/6.0/os/i386/Packages/centos-indexhtml-6-1.el6.centos.noarch.rpmwget http://mirrors.163.com/centos/6.0/os/i386/Packages/centos-release-6-0.el6.centos.5.i686.rpm
安装这2个包即可。
yum clean all
到这儿跟换RHEL的YUM源到Centos的操作已经完成了。
From WizNoteTime=2013-01-29 15:32:31