Redhat 7 Yum Source replaced with CentOS

Source: Internet
Author: User
Tags aliyun

Background: The author intends to do KVM virtualization in Redhat when installing the Virt-manager discovery hint to register Red Hat's Yum source, simply say money. It's impossible to give you money, so there's a CentOS source below that replaces the Yum source of REDHAT7.

Overview of the future (summary of steps)

    1. Uninstall the original Yum RPM package
    2. Download CentOS necessary Yum package to Ali Mirror Station
    3. RPM-IVH yum-installation corresponding to rpm
    4. Go to Ali Mirror Station to download Centos-base.repo, and modify
    5. Clear Yum Cache, then regenerate cache
    6. Test using yum-y Install XXX

Detailed steps:
View the original Yum
[Email protected] yum.repos.d]# Rpm-qa |grep Yum
Yum-3.4.3-158.el7.centos.noarch
Yum-plugin-fastestmirror-1.1.31-45.el7.noarch
Yum-metadata-parser-1.1.4-10.el7.x86_64
Yum-utils-1.1.31-45.el7.noarch
Yum-updateonboot-1.1.31-45.el7.noarch
[Email protected] yum.repos.d]#

Uninstall the above installation package
Rpm-qa | grep Yum | Xargs rpm-e--nodeps

Check again to see if deletion is complete
[Email protected] yum.repos.d]# Rpm-qa |grep Yum

Ensure that the host can surf the Internet (in order to go to the Ali Mirror station to download the corresponding RPM package: https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/)
[[email protected] yum.repos.d]# Ping www.hao123.com
PING hao123.n.shifen.com (112.34.111.167) bytes of data.
Bytes from 112.34.111.167:icmp_seq=1 ttl=128 time=55.8 ms
Bytes from 112.34.111.167:icmp_seq=2 ttl=128 time=54.2 ms
Bytes from 112.34.111.167:icmp_seq=3 ttl=128 time=48.1 ms
^c
---hao123.n.shifen.com ping statistics---
3 Packets transmitted, 3 received, 0% packet loss, time 2003MS
RTT Min/avg/max/mdev = 48.114/52.736/55.804/3.326 ms

Download locally: For example:

Install the downloaded package
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-45.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-45.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm
After that, the direct installationrpm -ivh yum-*

After you find a problem with the prompt

Later it was found that the Python-urlgrabber and RPM versions are too low; so you can go to the downloaded version or update it directly
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-32.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm
and then update
RPM-UVH rpm-4.11.3-32.el7.x86_64.rpm--nodeps
RPM-UVH python-urlgrabber-3.10-8.el7.noarch.rpm--nodeps

Then execute yum-y install yum-* again

Check to see if the above RPM packages are installed.

Go to Ali Mirror Station to download Centos-7.repo
CentOS 7

Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-7.repo

Vim/etc/yum.repos.d/centos-base.repo
Replace the releasever with the version number of the existing system (7)
Vim Replacement Command
:%s/$releasever/7/g

Last execute Yum clean all clear cache
Yum Makecahe Regenerate Cache

Redhat 7 Yum Source replaced with CentOS

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.