Redhat configure yum source using centos

Source: Internet
Author: User
RedHat products include RedHatLinux (such as Redhat8, 9) and RedHatEnterpriseLinux released for enterprises. CentOS is short for communitypoliciseoperatingsystem. many of us call it a community enterprise operating system. no matter how you call it, it is a release version of linux. Most of the software packages that constitute RHEL are developed based on the GPL protocol.

Red Hat products include RedHat Linux (such as Redhat8, 9) and Red Hat Enterprise Linux for enterprises. CentOS is short for Community ENTerprise Operating System. many of us call it a Community ENTerprise Operating System. no matter how you call it, it is a release version of linux.

Most software packages that constitute RHEL are released based on the GPL protocol, which we often call the open-source software. because of this, Red Hat also follows this agreement, publish the software package that constitutes RHEL. anyone who follows the GPL protocol can develop and release the software on the basis of the original software. In this way, CentOS is a Linux release version that constitutes a clone and reproduction of RHEL on the basis of RHEL release. The clone version of RHEL is not only CentOS, but also White Box Enterprise Linux and TAO Linux and Scientific Linux.

Although it is a RHEL clone, it is not exactly the same. the clone is 100% interchangeable (really ?). However, it is not guaranteed that the software corresponding to RHEL can work normally for 100% of CentOS. In addition, security vulnerability fixes and software package upgrades correspond to RHEL's paid services and technical support, which also result in latency of several stars and months.

If the redhat Enterprise Edition is applicable to yum sources and so on, it is applicable to Red Hat commercial support and requires paid registration. However, Red Hat Enterprise and centOS are essentially the same thing, except that the former will obtain the commercial services provided by redhat. Then, we only need to configure yum in Red Hat Enterprise to centOS. The configuration process is as follows:

Lab environment:

Red Hat Enterprise 5.4, CentOS 5.4.

  • DeleteYum software in Red Hat Enterprise:

Rpm-qa | grep yum.

Then delete all yum-related programs listed: rpm-e youryumapp

  • Save your yum configuration file and run the following command:

Cd/etc/yum. repos. d/

Mv CentOS-Base.repo CentOS-Base.repo.bak

  • Select the source configuration file for the corresponding CentOS version. here we use the CentOS source of HKUST:

Wget http://centos.ustc.edu.cn/CentOS-Base.repo

Better sources include NetEase and Sohu:

Wget http://mirrors.163.com/.help/CentOS-Base-163.repo

Wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

  • Modify the configuration file.

Some source configuration files may contain the following content:

  1. [Base]
  2. Name = CentOS-$ releasever-Base
  3. Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
  4. Baseurl = http://developer.centos.org/centos/?releasever/ OS /?basearch/
  5. Baseurl = http: // mirrors.sohu.com/centos/?releasever/ OS /?basearch/
  6. Gpgcheck = 1
  7. Gpgkey = http: // developer.centos.org/centos/rpm-gpg-key-centos-5

Make sure to comment out all the referers in the list (add #), and replace the baseurl with the format in step 5 (for NetEase and Zhongke da, refer to the modification ).

Now, after the above steps, the source in redhat has been configured as the CentOS source. You only need to install the yum component for updates.

  • Install the yum component from CentOS.

Here, you need to find the yum installation component from the CentOS installation package corresponding to your redhat system. For the version of CentOS and Redhat, see another blog:

Http://blog.csdn.net/NEOMc/archive/2011/04/19/6334400.aspx

Find and install the following components in the CentOS installation package:

Sudo rpm-ivh yum-updatesd-0.9-2.el5.noarch.rpm
Sudo rpm-ivh yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm

Sudo rpm-ivh yum-3.2.22-20.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm

Note: it is best to install the last two packages together because these two rpm packages are mutually dependent. This is also a small trick. you can install it together in the future when there is a dependency package.

 

  • Update yum

Execute yum makecache to cache local data. Run the yum list command to check all locally cached yum installation package data?

Congratulations, you have successfully replaced the Redhat source to enjoy the fun of Linux!

If you have any questions or suggestions, please feel free to leave a message.

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.