There are a lot of friends using the Linux Redhat version is not still worried about the installation of RPM package, the use of the Yum tool is not a good tool to solve this problem, he can solve the problem of dependencies in the package installation, But for the Redhat version of the system, if you want to use Yum's online installation function is the need for silver, that there is no silver under the Redhat can use Yum, answer is sure to use, We can use the CentOS system Open source package to configure our Yum tool accordingly.
The configuration is as follows:
since Redhat's yum online update is chargeable, it cannot be used if not registered, that is, the software cannot be installed online. in this case, want to use Redhat system, also want to use Yum source to install software online, there is no way?
The answer is there is a way, please look down!
1 , delete redhat original yum source
# Rpm-aq | grep Yum|xargs rpm-e--nodeps
2 , download the new Yum installation package
Here we use the source of the CentOS Yum
# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
3 , installing the Yum 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 packages are to be installed together at the same time, otherwise you will be prompted to rely on each other and the installation fails.
4 , change the yum source #我们使用网易的CentOS镜像源
# 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 $releasever in the file with the version number, which is 6 last saved! Or simply copy the following memory to the Centos6-base-163.repo file (modified)
:%s/$releasever/6/g
#########################################################################
# 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 is updated to and
# Geographically close to the client. You should the use of this for CentOS updates
# Unless you is manually picking other mirrors.
#
# If The mirrorlist= does not work for you, as a fall back to 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 could 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
#########################################################################
5 , clean up the Yum cache
# Yum Clean All
# yum Makecache #将服务器上的软件包信息缓存到本地 to improve the speed of search and install software
# yum Install vim* #测试域名是否可用
At this point, Redhat6 can use CentOS's yum source to install software online!
Second, local Yum source configuration
1. Mount the ISO file
#mount-T iso9660/dev/cdrom/mnt/iso/
2. Modify the Yum configuration file
#vi/etc/yum.repo.d/iso
===============
[Base]
Name=locale
Baseurl=file:///mnt/iso/server
Enabled=1---Turn on local update mode
Gpgcheck=1
===============
Redhat-6
====================================
[Server]
Name=server
Baseurl=file:///mnt/cdrom/server
Enabled=1
Gpgcheck=0
[Highavailability]
Name=highavailability
Baseurl=file:///mnt/cdrom/highavailability
Enabled=1
Gpgcheck=0
[LoadBalancer]
Name=loadbalancer
Baseurl=file:///mnt/cdrom/loadbalancer
Enabled=1
Gpgcheck=0
[LoadBalancer]
Name=loadbalancer
Baseurl=file:///mnt/cdrom/loadbalancer
Enabled=1
Gpgcheck=0
3. Clean up the cache
#yum Clean All
Note: error handling
Yum encountered "Warning:rpmts_HdrFromFdno:Header V3 DSA Signature:nokey" solution when installing RPM packages
Installing RPM with Yum under Redhat Linux sometimes causes the installation to fail with the following error
Warning:rpmts_HdrFromFdno:Header V3 DSA Signature:nokey, key id*****
This is due to the fact that Yum has installed an older version of the GPG keys, and the workaround is to run the following command:
$ sudo rpm--import/etc/pki/rpm-gpg/rpm*
Configuring the use of the Yum source under Redhat6