1.卸载HedHat5.4的yum命令 
    先查看RedHat上是否安装yum 
    
   
    删除所有的yum软件 
    rpm -qa | grep yum | xargs rpm -e --nodeps

2.下载新的yum包

wget http://vault.centos.org/5.4/os/x86_64/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm

wget http://vault.centos.org/5.4/os/x86_64/CentOS/yum-3.2.22-20.el5.centos.noarch.rpm

wget http://vault.centos.org/5.4/os/x86_64/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm

wget http://vault.centos.org/5.4/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm

# rpm -ivh yum-*    #安装

# rpm -qa yum    #查看是否已经安装上
注意:yum和yum-fastestmirror相互依赖,所以同时安装即可。 

  1. 在CentOS下有的时候用yum安装软件的时候最后会提示:
  2. warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID*****
  3. 这是由于yum安装了旧版本的GPG keys造成的,解决办法就是
  4. 下载并导入Key
  5. cd /etc/pki/rpm-gpg
  6. wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  7. rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
  8. 或者  一条  rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
检测安装的 yum 是否有问题,执行命令进行测试:
yum clean all 重建yum缓存 
yum makecache 外网的yum源
vim /etc/yum.repos.d/CentOS-Base.repo
输入一下内容

# 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-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://vault.centos.org/5.11/os/$basearch/
gpgcheck=1 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://vault.centos.org/5.11/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://vault.centos.org/5.11/extras/$basearch/
gpgcheck=1 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://vault.centos.org/5.11/centosplus/$basearch/
gpgcheck=1 
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
baseurl=http://vault.centos.org/5.11/contrib/$basearch/
gpgcheck=1 
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5</span></strong></span>

无视依赖关系安装 --force --nodeps   

# rpm -ivh db4-devel-4.3.29-9.fc6.i386.rpm --force --nodeps 

https://blog.csdn.net/m0_37886429/article/details/75009382

最新文章

  1. OSI七层模型及TCP/IP四层模型
  2. (转)整体把握jQuery -jQuery 的原型关系图
  3. 总有一项适合你:联想 Miix2 8寸版触摸屏失灵的各项解决方案
  4. linux修改主机名的方法
  5. 2015年8月18日,杨学明老师《技术部门的绩效管理提升(研讨会)》在中国科学院下属机构CNNIC成功举办!
  6. Flash图表控件FusionCharts自定义图表y轴最大/最小值
  7. ace 读取excel
  8. IIS 7 WAS服务不可用
  9. Jquery 获取文件内容
  10. How do disable paging by swiping with finger in ViewPager but still be able to swipe programmatically?
  11. 自动发布工具版本从python2升级成python3后遇到的种种问题(涉及paramiko,Crypto,zipfile等等)
  12. vultr vps官网改版免费注册教程(最新优惠码)
  13. 深入理解null的原理
  14. 深入Redis持久化
  15. tp5生成6位不重复验证码
  16. JNI内存泄露JNI ERROR (app bug): local reference table overflow (max=512)
  17. webpack多页面配置
  18. 【JVM】jvm虚拟机参数解析
  19. windows 10 专业版 激活
  20. springmvc整合mybatis 配置文件

热门文章

  1. 查看环境变量CLASSPATH, PATH ,JAVA_HOME--------&gt;mac
  2. Linux 常用资源
  3. 剑指Offer——两个链表的第一个公共结点
  4. python中yield使用
  5. Celery(一个懂得 异步任务、定时任务、周期任务 的&quot;芹菜&quot;)
  6. Centos配置nginx反向代理8090端口到80端口
  7. JMS术语
  8. 8种主要排序算法的C#实现 (二)
  9. 手把手教 GitHub + Hexo 搭建博客
  10. android 如何获取当前的Activity类名