Configure yum source using centos in redhat

Source: Internet
Author: User

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.