1. 程式人生 > >Redhat6.6更改網易yum源

Redhat6.6更改網易yum源

yum安裝軟件 ret ras 3.2 parser hat rpm yum man gem

當前系統版本

[root@redhat-128 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.6 (Santiago)

yum安裝軟件報錯

[root@redhat-128 ~]# yum install -y net-snmp
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
No package net-snmp available.
Error: Nothing to do

查詢redhat6 yum相關依賴包

[root@redhat-128 ~]# rpm -qa | grep yum
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-utils-1.1.30-30.el6.noarch
yum-rhn-plugin-0.9.1-50.el6.noarch
yum-plugin-security-1.1.30-30.el6.noarch
yum-3.2.29-60.el6.noarch

卸載redhat6 yum相關依賴包
[root@redhat-128 ~]# rpm -qa | grep yum|xargs rpm -e --nodeps

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

安裝python-iniparse、yum-metadata-parser組件

[root@redhat-128 ~]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
[root@redhat-128 ~]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

python-2.6.6卸載並重新安裝

[root@redhat-128 ~]# wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.5/x86_64/updates/security/python-2.6.6-64.el6.x86_64.rpm
[root@redhat-128 ~]# python -V
Python 2.6.6
[root@redhat-128 ~]# rpm -e python-2.6.6-52.el6.x86_64 --nodeps
[root@redhat-128 ~]# rpm -ivh  python-libs-2.6.6-66.el6_8.x86_64.rpm  python-2.6.6-64.el6.x86_64.rpm --nodeps  --force
warning: python-libs-2.6.6-66.el6_8.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
warning: python-2.6.6-64.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
Preparing...                ########################################### [100%]
   1:python                 ########################################### [ 50%]
   2:python-libs            ########################################### [100%]

安裝python-urlgrabber組件

[root@redhat-128 ~]# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm --nodeps --force
warning: python-urlgrabber-3.9.1-11.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:python-urlgrabber      ########################################### [100%]

安裝yum組件
[root@redhat-128 ~]# rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
warning: yum-3.2.29-81.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:yum-plugin-fastestmirro########################################### [ 50%]
   2:yum                    ########################################### [100%]

更換網易centos6鏡像,將$releaseserve替換為6
[root@redhat-128 ~]# wget -O /etc/yum.repos.d/CentOS6-Base-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

#清除原有緩存,重建緩存

[root@redhat-128 ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@redhat-128 ~]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
base                                                                                                                                                    | 3.7 kB     00:00     
base/group_gz                                                                                                                                           | 226 kB     00:00     
base/filelists_db                                                                                                                                       | 6.4 MB     01:50     
base/primary_db                                                                                                                                         | 4.7 MB     00:11     
base/other_db                                                                                                                                           | 2.8 MB     00:09     
extras                                                                                                                                                  | 3.4 kB     00:00     
extras/filelists_db                                                                                                                                     |  26 kB     00:00     
extras/prestodelta                                                                                                                                      | 1.3 kB     00:00     
extras/primary_db                                                                                                                                       |  29 kB     00:00     
extras/other_db                                                                                                                                         |  30 kB     00:00     
updates                                                                                                                                                 | 3.4 kB     00:00     
updates/filelists_db                                                                                                                                    | 3.5 MB     00:04     
updates/prestodelta                                                                                                                                     | 171 kB     00:00     
updates/primary_db                                                                                                                                      | 5.8 MB     00:21     
updates/other_db                                                                                                                                        |  83 MB     04:42     
Metadata Cache Created

重新安裝net-snmp

[root@redhat-128 ~]# yum install -y net-snmp
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package net-snmp.x86_64 1:5.5-60.el6 will be installed
--> Processing Dependency: net-snmp-libs = 1:5.5-60.el6 for package: 1:net-snmp-5.5-60.el6.x86_64
--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-5.5-60.el6.x86_64
--> Processing Dependency: libnetsnmptrapd.so.20()(64bit) for package: 1:net-snmp-5.5-60.el6.x86_64
--> Processing Dependency: libnetsnmpmibs.so.20()(64bit) for package: 1:net-snmp-5.5-60.el6.x86_64
--> Processing Dependency: libnetsnmphelpers.so.20()(64bit) for package: 1:net-snmp-5.5-60.el6.x86_64
--> Processing Dependency: libnetsnmpagent.so.20()(64bit) for package: 1:net-snmp-5.5-60.el6.x86_64
--> Processing Dependency: libnetsnmp.so.20()(64bit) for package: 1:net-snmp-5.5-60.el6.x86_64
--> Running transaction check
---> Package lm_sensors-libs.x86_64 0:3.1.1-17.el6 will be installed
---> Package net-snmp-libs.x86_64 1:5.5-60.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================
 Package                                        Arch                                  Version                                        Repository                           Size
===============================================================================================================================================================================
Installing:
 net-snmp                                       x86_64                                1:5.5-60.el6                                   base                                309 k
Installing for dependencies:
 lm_sensors-libs                                x86_64                                3.1.1-17.el6                                   base                                 38 k
 net-snmp-libs                                  x86_64                                1:5.5-60.el6                                   base                                1.5 M

Transaction Summary
===============================================================================================================================================================================
Install       3 Package(s)

Total download size: 1.9 M
Installed size: 6.3 M
Downloading Packages:
(1/3): lm_sensors-libs-3.1.1-17.el6.x86_64.rpm                                                                                                          |  38 kB     00:00     
(2/3): net-snmp-5.5-60.el6.x86_64.rpm                                                                                                                   | 309 kB     00:00     
(3/3): net-snmp-libs-5.5-60.el6.x86_64.rpm                                                                                                              | 1.5 MB     00:02     
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                          134 kB/s | 1.9 MB     00:14     
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <[email protected]>"
 From  : http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 4 pre-existing rpmdb problem(s), ‘yum check‘ output follows:
python-2.6.6-64.el6.x86_64 has missing requires of python-libs(x86-64) = (‘0‘, ‘2.6.6‘, ‘64.el6‘)
python-libs-2.6.6-66.el6_8.x86_64 is a duplicate with python-libs-2.6.6-52.el6.x86_64
python-urlgrabber-3.9.1-11.el6.noarch is a duplicate with python-urlgrabber-3.9.1-9.el6.noarch
rhn-check-1.0.0.1-18.el6.noarch has missing requires of yum-rhn-plugin >= (‘0‘, ‘0.9.1‘, ‘35‘)
  Installing : lm_sensors-libs-3.1.1-17.el6.x86_64                                                                                                                         1/3 
  Installing : 1:net-snmp-libs-5.5-60.el6.x86_64                                                                                                                           2/3 
  Installing : 1:net-snmp-5.5-60.el6.x86_64                                                                                                                                3/3 
  Verifying  : lm_sensors-libs-3.1.1-17.el6.x86_64                                                                                                                         1/3 
  Verifying  : 1:net-snmp-libs-5.5-60.el6.x86_64                                                                                                                           2/3 
  Verifying  : 1:net-snmp-5.5-60.el6.x86_64                                                                                                                                3/3 

Installed:
  net-snmp.x86_64 1:5.5-60.el6                                                                                                                                                 

Dependency Installed:
  lm_sensors-libs.x86_64 0:3.1.1-17.el6                                                    net-snmp-libs.x86_64 1:5.5-60.el6                                                   

Complete!

Redhat6.6更改網易yum源