RedHat 6.5 configures the yum source using centos

After installing RedHat 6.5, log in to the system and update the system using yum update. Tips:

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Unable to update.

The default Yum source of redhat needs to be registered before it can be updated. We want to update it at no cost. We need to replace the yum source of redhat.

 

1. Check if yum package is installed

Check whether RHEL has installed yum. If so, what are the yum packages

[root@localhost ~]# rpm -qa |grep yum

yum-metadata-parser-1.0-8.fc6

yum-3.0.1-5.el5

yum-rhn-plugin-0.4.3-1.el5

yum-updatesd-3.0.1-5.el5

2. Delete the yum package of redhat

Uninstall all yum packages shown above:

[root @ localhost ~] ා rpm - qa| grep yum| xargs rpm - E -- nodeps (delete rpm package directly without checking dependency)

Reuse

[root@localhost ~]# rpm -qa |grep yum

[root@localhost ~]# 

View, no information display indicates that the uninstall is complete.

3. Download the new yum package. yum package using Centos6.5

# wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
# wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
# wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

 

 

Install yum package

Note: a single installation package may depend on other packages (for example, yum and Yum fastestmirror depend on each other), so we can put all these packages together and install them at the same time with one line of command:

# rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

4. Replace yum source. Source using 163

# cd /etc/yum.repos.d/
# wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo
# vi CentOS6-Base-163.repo

Edit the file, and replace all the $releasers in the file with the version number, that is, 6.5 is saved finally! Or directly copy the following memory to CentOS6-Base-163.repo file (modified)

# 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 should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-6 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&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/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-6 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&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]
name=CentOS-6 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&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]
name=CentOS-6 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

5. Clear the original cache

# yum clean all

Rebuild the cache to improve the speed of searching and installing software

# yum makecache

6. Update the system

# yum update

Tags: CentOS yum RPM Red Hat

Posted on Sun, 10 Nov 2019 16:23:05 -0500 by dmschenk