RedHat Enterprise&nbs…

Idea: Uninstall redhat comes yum, and then download the centos yum, modify the configuration file after installation

 

1 , first of all to http://mirrors.163.com/centos download packages

 

x86 address: http: //mirrors.163.com/centos/6/os/i386/Packages/

x86_64 address: http: //mirrors.163.com/centos/6/os/x86_64/Packages/

Download the necessary software packages have (64-bit system as an example):

a  python-iniparse-0.3.1-2.1.el6.noarch.rpm

b  yum-3.2.29-40.el6.centos.noarch.rpm

c  yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

d  yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

Download Command:

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

[Note]: not necessarily the latest version

 

2 , unloading RedHat comes with yum

 

      rpm -qa | grep yum | xargs rpm -e --nodeps

      Note: a, xargs is a Unix and Unix-like operating systems commonly used commands. Its role is to convert into small segments parameter list passed to other commands, the parameter list is too long to avoid problems in

          b, - nodeps force uninstall, regardless of dependency

 

3 , install the downloaded centos of yum package:

 

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm

rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

 

[Note]: The last two need to be installed together, otherwise dependent error occurs

 

4 , to http://mirrors.163.com the centos help document download CentOS6-Base-163.repo file, stored in /etc/yum.repo.d in

 

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

 

5 , edit CentOS6-Base-163.repo file, which will be $ releasever change centos version number

Here is the edited:

# 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&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&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&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&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&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

6 , yum Clean All Clear original cache

7 , yum makecache  get yum list

The following prompt appears to indicate changes are complete yum:

Metadata Cache Created

 

Welcome to reprint, please indicate the source, thank you!

Published 117 original articles · won praise 4 · views 80000 +

Guess you like

Origin blog.csdn.net/qq_36266449/article/details/78194647