RHEL6 sets CentOS yum source

Source: Internet
Author: User
In this article, the 64-bit version of RHEL6 is configured to use the CentOS yum source of NetEase. most of the content is from the Yum source of RHEL6 basics (23) RHEL using centos (default 32-bit version ), therefore, the logo is Reprinted. At the same time, this article also refer to the two methods for configuring the yum source, which are listed together. Prepare to create a directory/src to store the 64-bit version of RHEL6 in this article. configure and use the CentOS yum source of NetEase. The vast majority of the content comes from the use of RHEL6 basics (23) RHEL. CentosYum source (default 32-bit version of the original version.

At the same time, this article also refer to the two methods for configuring the yum source, which are listed together.

Preparations

Create a directory/src to store the files to be downloaded later.

[Root @ localhost ~] #Mkdir/src

Switch to the/src Directory

[Root @ localhost ~] #Cd/src

[Root @ localhost src] #

Uninstall the original YUM of RHEL6

Query the original YUM information

[Root @ localhost src] #Rpm-q yum
...

Uninstall the original YUM and test whether the unmount is successful.

[Root @ localhost src] # Rpm-qa | grep yum | xargs rpm-e -- nodeps
Warning:/etc/yum. conf saved as/etc/yum. conf. rpmsave
[Root @ localhost src] # Yum install php
-Bash:/usr/bin/yum: The file or directory does not exist. Download the CentOS YUM installation package from NetEase

Use the wget command to download five files: yum, yum-plugin-fastestmirror, yum-metadata-parser, python-iniparse, and RPM-GPG-KEY-CentOS-6.

Note: the font of the code is Courier New. the numbers 1 and l are easy to confuse. Note that "el6" is "EL6" rather than "E16 ".

[Root @ localhost src] #Wgethttp: // response
[Root @ localhost src] #Wgethttp: // response
[Root @ localhost src] #Wgethttp: // response
[Root @ localhost src] #Wgethttp: // response
[Root @ localhost src] #Wgethttp: // mirrors.163.com/centos/6/ OS /x86_64/RPM-GPG-KEY-CentOS-6

Install YUM

First, install python-iniparser

[Root @ localhost src] #Rpm ivhpython-iniparse-0.3.1-2.1.el6.noarch.rpm

Secondly, import GPG-KEY

[Root @ localhost src] #Rpm -- importRPM-GPG-KEY-CentOS-6

Again, install yum-metadata-parser

[Root @ localhost src] #Rpm ivhyum-metadata-parser.1.1.2-16.el6.x86_64.rpm

Finally, install yum and yum-plugin-fastestmirror simultaneously (because they are mutually dependent)

[Root @ localhost src] #Rpm ivhyum-3.2.29-40.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

Modify YUM source

Switch to the/etc/yum. repos. d Directory

[Root @ localhost src] #Cd/etc/yum. repos. d
[Root @ localhost yum. repos. d] #

Download NetEase YUM source configuration

[Root @ localhost yum. repos. d] #Wgethttp: // mirrors.163.com/.help/CentOS6-Base-163.repo
[Root @ localhost yum. repos. d] #

Use vim to view CentOS6-Base-163.repo files. In vim command mode, enter % s/$ releasever/6/g to replace $ releasever in the entire file with 6. After the replacement is successful, a message indicating 15 replicas is displayed. Finally, in vim command mode, enter wq and press enter to save and exit.

[Root @ localhost yum. repos. d] # VimCentOS6-Base-163.repo

...

...

...

: % S/$ releasever/6/g

: Wq

[Root @ localhost yum. repos. d] #

Clear YUM cache

[Root @ localhost yum. repos. d] #Yum clean all

Test the new YUM source and try to install XTERM

Query the original XTERM information

[Root @ localhost src] #Rpm-q xterm
Package xterm is not installed

Install XTERM using YUM

[Root @ localhost src] #Yum install xterm

The XTERM installation process is as follows:

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.