参考:
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后再执行。
- cat >/etc/yum.repos.d/CentOS-Base.repo<<eof
- [base]
- name=CentOS-$releasever - Base
- baseurl=http://mirrors.kernel.org/centos/$releasever/os/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #released updates
- [updates]
- name=CentOS-$releasever - Updates
- baseurl=http://mirrors.kernel.org/centos/$releasever/updates/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #packages used/produced in the build but not released
- [addons]
- name=CentOS-$releasever - Addons
- baseurl=http://mirrors.kernel.org/centos/$releasever/addons/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #additional packages that may be useful
- [extras]
- name=CentOS-$releasever - Extras
- baseurl=http://mirrors.kernel.org/centos/$releasever/extras/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-$releasever - Plus
- baseurl=http://mirrors.kernel.org/centos/$releasever/centosplus/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
- gpgcheck=1
- enabled=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #contrib - packages by Centos Users
- [contrib]
- name=CentOS-$releasever - Contrib
- baseurl=http://mirrors.kernel.org/centos/$releasever/contrib/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
- gpgcheck=1
- enabled=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- eof
再执行:yum makecache 生成缓存,再yum install 安装软件试试
阅读(827) | 评论(0) | 转发(0) |