RedHat 6.7 using the source CentOS 6

  • 1. Remove the relevant RedHat Package
# yum -y remove subscription-manager and rh-check
# rpm -aq | grep yum | xargs rpm -e --nodeps
  • 2. Download the CentOS yum package dependencies and
    dependent packages:
yum
yum-plugin-fastestmirror
python-urlgrabber
yum-metadata-parser

Yum-pkgs create a file, the file contents:

http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

Use wget to download
# wget --input-file=yum-pkgs --directory-prefix=/opt/ --continue
Of course, there are graphical interface case you can use the browser to download.

  • 3. Install yum
# rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm python-urlgrabber-3.9.1-11.el6.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

To install these packages, because these packages are interdependent.

  • 4. Key Import the PGP
    RPM-PGP Keys-file:
http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-Debug-6
http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-Security-6
# wget --input-file=rpm-pgp-keys --directory-prefix=/opt/ --continue
# rpm --import /opt/RPM-GPG-KEY-*
  • The acquisition source of the file CentOS
# cd /etc/yum.repos.d
# mv rhel-source.repo rhel-source.repo.ori
# mv packagekit-media.repo packagekit-media.repo.ori
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
# yum clean all
# yum makecache

Guess you like

Origin www.cnblogs.com/DouglasHall/p/11026981.html