Linux: Switch Rhel yum to CentOS Yum

Source: Internet
Author: User
Tags gpg

Red Hat Enterprise Linux Server (RHEL) Yum installs the software when this system is not a registered with the portal. Portal support would be disabled. Red Hat Enterprise Linux Server (RHEL) Yum service is paid because there is no payment, so yum can not be used to install software, such as RHEL want to install LNMP must first set up Yum as this tutorial, And can be used after the installation of LNMP one-click installation package, will prompt the following error: This system is not registered to Red Hat Subscription Management. You can use the Subscription-manager to register. or the following error message: This system was not a registered with the portal. Portal support would be disabled.

Workaround:
Execution: Rpm-qa|grep Yum|xargs rpm-e--nodeps to uninstall Yum
Cat/etc/issue && uname-a Look at the system version number and the number of system bits

To http://mirrors.kernel.org/centos/or http://mirrors.163.com/centos/to find the corresponding system version number

If the system is 5.* 64-bit, open the http://mirrors.kernel.org/centos/5/os/x86_64/CentOS/
If the system is 5.* 32-bit, open the http://mirrors.kernel.org/centos/5/os/i386/CentOS/
If the system is 6.* 32-bit: http://mirrors.kernel.org/centos/6/os/i386/Packages/
If the system is 6.* 32-bit: http://mirrors.kernel.org/centos/6/os/i386/Packages/

Find the address of the 3 packages of Yum, Yum-fastestmirror, Yum-metadata-parser, and then execute: The following command may not download, to the above URL to find the corresponding download file! Here is the Rhel 5.* 64-bit example, the following links may change, self-replacement
wget http://mirrors.kernel.org/centos/5/os/x86_64/centos/ yum-3.2.22-39.el5.centos.noarch.rpmwget http://mirrors.kernel.org/centos/5/os/x86_64 /centos/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpmwget http://  mirrors.kernel.org/centos/5/os/x86_64/centos/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm

Download the 3 packages below and then execute:
RPM-IVH yum-*
Re-execute: (if it is a 6.* version, then the contents of the following 5 is changed to 6, while the following files in the $releasever all replaced with the version number 5 or 6 before execution. )

Cat>/etc/Yum.repos.d/centos-base.repo<<Eof[base]name=centos-$releasever-Basebaseurl=http://mirrors.kernel.org/centos/$releasever/os/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=osgpgcheck=1Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#released Updates [Updates]name=centos-$releasever-Updatesbaseurl=http://mirrors.kernel.org/centos/$releasever/updates/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=updatesgpgcheck=1Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#packages used/producedinchThe build but not released[addons]name=centos-$releasever-Addonsbaseurl=http://mirrors.kernel.org/centos/$releasever/addons/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=addonsgpgcheck=1Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#additional Packages that could be useful[extras]name=centos-$releasever-Extrasbaseurl=http://mirrors.kernel.org/centos/$releasever/extras/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=extrasgpgcheck=1Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#additional packages that extend functionality of existing Packages[centosplus]name=centos-$releasever-Plusbaseurl=http://mirrors.kernel.org/centos/$releasever/centosplus/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=centosplusgpgcheck=1enabled=0Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5#contrib-packages by Centos Users[contrib]name=centos-$releasever-Contribbaseurl=http://mirrors.kernel.org/centos/$releasever/contrib/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=contribgpgcheck=1enabled=0Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5Eof

Note:

1) If it is 7, there is no addons, you can remove the configuration of the [addons] zone.

2) The version number of the Gpgkey is consistent with the downloaded version.

3) When using the above script, the variable $releaserver represents the system version number, $basearch represents the arch version (e.g. x86_64)

Linux: Switch Rhel yum to CentOS Yum

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.