RedHat 6.0 how to use centos Yum source update

Source: Internet
Author: User
    • 6.0
    • 5.4

 

Address: http://www.linuxde.net/2011/10/1578.html

October 31, 2011 by Tian Ming | 2 comments | 1,267 views
Because RedHat Yum online updates are charged, you cannot use them if you have not registered them, that is, you cannot install software online. In this case, do you want to use the RedHat system and install software online using the yum source?
There is a solution. Please read it down!
1. Delete the original Yum source of RedHat.

# Rpm-AQ | grep Yum | xargs rpm-e -- nodeps
2. download the new Yum installation package

Here we use the centos Yum Source

# Wget http://mirror.centos.org/centos-6/6/ OS /i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

# Wget http://mirror.centos.org/centos-6/6/ OS /i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
# Wget http://mirror.centos.org/centos-6/6/ OS /i386/Packages/yum-3.2.29-22.el6.centos.noarch.rpm
# Wget http://mirror.centos.org/centos-6/6/ OS /i386/Packages/yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm
3. Install the yum Software Package

# rpm-IVH python-iniparse-0.3.1-2.1.el6.noarch.rpm
# rpm-IVH yum-metadata-parser-1.1.2-14.1.el6.i686.rpm
# rpm-IVH yum-3.2.27-14.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
Note: The last two installation packages should be installed together, otherwise, the system prompts mutual dependency and installation fails.
4. Change the yum source # Use the centos image source of Netease

# cd/etc/yum. repos. d/
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
# vi CentOS6-Base-163.repo
edit the file, replace all the $ releasever in the file with the version number, that is, 6 last saved! Or directly copy the following memory to the CentOS6-Base-163.repo file (modified)
##################################### ####################################< br> # centOS-Base.repo
# The mirror system uses the connecting IP address of the client and the
# Update Status of each mirror to pick mirrors that are updated to and
# geographically close to the client. you shoshould use this for centos updates
# Unless you are manually picking other mirrors.
# If the specified list = does not work for you, as a fall back you can try the
# remarked out baseurl = line instead.
#< BR >#

[Base]
Name = CentOS-6-base-163.com
Baseurl = http://mirrors.163.com/centos/6/ OS /?basearch/
# Items list = http://mirrorlist.centos.org /? Release = 6 & arch = $ basearch & repo = OS
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# Released updates
[Updates]
Name = CentOS-6-Updates-163.com
Baseurl = http://mirrors.163.com/centos/6/updates/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = 6 & arch = $ basearch & repo = updates
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# Additional packages that may be useful
[Extras]
CentOS-6-extras-163.com
Baseurl = http://mirrors.163.com/centos/6/extras/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = 6 & arch = $ basearch & repo = extras
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# Additional packages that extend functionality of existing packages
[Centosplus]
CentOS-6-plus-163.com
Baseurl = http://mirrors.163.com/centos/6/centosplus/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = 6 & arch = $ basearch & repo = centosplus
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# Contrib-packages by centos users
[Contrib]
CentOS-6-contrib-163.com
Baseurl = http://mirrors.163.com/centos/6/contrib/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = 6 & arch = $ basearch & repo = contrib
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

######################################## #################################
5. Clear Yum Cache

# Yum clean all
# Yum makecache # cache the software package information on the server to a local machine to speed up searching and installing software
# Yum install Vim * # test whether the domain name is available
Now, redhat6 can use centos Yum source to install software online!

 

Original article link

Today, I had to maintain a Linux-installed machine, so I thought I could solve the problem based on my previous experience. However, I discovered that a bunch of software packages on the machine were not installed,
The worst thing is that even the package manager is not installed. I thought it was FreeBSD. I checked it and found it was RedHat Linux Server 5.4,
So I started to install yum. I searched on Google and found that there were not many similar cases, but this was not the first time I met RedHat without yum,
Because the last time someone asked for help, they could not solve the problem and did not pay attention to it. However, this maintenance was necessary, so I tried it for a long time,
This is probably one of my most uncomfortable experiences, and there are not many resources for Redhat, so the basic RPM package uses centos 5, so I am full of resentment towards RedHat.

1. First, determine the system architecture
After confirming it is x86_64, download the desired RPM package in Netease's mirrors :( if it is i386, you need to find the corresponding package in the http://mirrors.163.com/centos/5/ OS /i386/CentOS)

 

Wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/m2crypto-0.16-8.el5.x86_64.rpm
Wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm
Wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
Wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/python-sqlite-1.1.7-1.2.1.x86_64.rpm
Wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/python-urlgrabber-3.1.0-6.el5.noarch.rpm
Wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm
Wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
Wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm

 

2. Install (upgrade) The software package and import the certificate.

 

# Rpm-uvh *
# Rpm-import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5

 

3. Enable Yum to use Netease's source:

 

# Cd/etc/yum. Repos. d/
# Wget http://mirrors.163.com/.help/CentOS-Base-163.repo

 

4. Use

# Vi CentOS-Base-163.repo

Add # before all the uploadlists, replace all $ releasever with 5, and save

 

5. Clear and regenerate the yum Cache

# Yum clean metadata
# Yum makecache

 

6. Then Yum will work normally, and update it as soon as possible.

# Yum-y upgrade

 

 

 

End

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.