Redhat6.6更改网易yum源 [图文版]

大城市里の小女人 提交于 2019-11-25 20:36:30

当前系统版本

[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 ~]#
Redhat6.6更改网易yum源 [图文版]
安装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

Redhat6.6更改网易yum源 [图文版]
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%]
![](![](https://s1.51cto.com/images/blog/201801/16/446dcba9c917d31d85f7e57de1869207.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)https://s1.51cto.com/images/blog/201801/16/1fb20802454ea130b67cb3d6c38c6488.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
安装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%]

Redhat6.6更改网易yum源 [图文版]
更换网易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
Redhat6.6更改网易yum源 [图文版]
#清除原有缓存,重建缓存

[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

Redhat6.6更改网易yum源 [图文版]
重新安装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) <centos-6-key@centos.org>"
 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源 [图文版]
备注:上述所安装rpm包都可在下面链接搜索下载的到。
mirrors.163.com/centos/6/os/x86_64/Packages/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!