Chinaunix首页 | 论坛 | 博客
  • 博客访问: 815659
  • 博文数量: 127
  • 博客积分: 3662
  • 博客等级: 中校
  • 技术积分: 1371
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-02 12:36
个人简介

Linux&MySQL&PHP&Nginx&Apache&MSSQL&Shell

文章分类

全部博文(127)

文章存档

2016年(1)

2015年(8)

2014年(14)

2013年(26)

2012年(17)

2011年(28)

2010年(33)

分类: LINUX

2012-12-07 12:52:16

参考:

rpm -qa|grep yum|xargs rpm -e --nodeps  将yum卸载掉

cat /etc/issue && uname -a 看一下系统版本号和系统位数

到  或  找对应系统版本号
如系统是5.5 64位,则打开 找到yum 、yum-fastestmirror、yum-metadata-parser 这3个软件包的地址,然后执行:

wget
wget
wget
#rpm -ivh yum-*

如果是6.*的版本,则将下面内容里面的5改成6后再执行。

点击(此处)折叠或打开

  1. cat >/etc/yum.repos.d/CentOS-Base.repo<<eof
  2. [base]
  3. name=CentOS-$releasever - Base
  4. baseurl=http://mirrors.kernel.org/centos/$releasever/os/$basearch/
  5. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  6. gpgcheck=1
  7. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  8. #released updates
  9. [updates]
  10. name=CentOS-$releasever - Updates
  11. baseurl=http://mirrors.kernel.org/centos/$releasever/updates/$basearch/
  12. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  13. gpgcheck=1
  14. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  15. #packages used/produced in the build but not released
  16. [addons]
  17. name=CentOS-$releasever - Addons
  18. baseurl=http://mirrors.kernel.org/centos/$releasever/addons/$basearch/
  19. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
  20. gpgcheck=1
  21. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  22. #additional packages that may be useful
  23. [extras]
  24. name=CentOS-$releasever - Extras
  25. baseurl=http://mirrors.kernel.org/centos/$releasever/extras/$basearch/
  26. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
  27. gpgcheck=1
  28. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  29. #additional packages that extend functionality of existing packages
  30. [centosplus]
  31. name=CentOS-$releasever - Plus
  32. baseurl=http://mirrors.kernel.org/centos/$releasever/centosplus/$basearch/
  33. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
  34. gpgcheck=1
  35. enabled=0
  36. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  37. #contrib - packages by Centos Users
  38. [contrib]
  39. name=CentOS-$releasever - Contrib
  40. baseurl=http://mirrors.kernel.org/centos/$releasever/contrib/$basearch/
  41. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
  42. gpgcheck=1
  43. enabled=0
  44. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  45. eof

再执行:yum makecache 生成缓存,再yum install 安装软件试试
阅读(827) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~