分类: LINUX
2012-04-09 16:01:17
感谢原创作者http://blog.sina.com.cn/s/blog_5d18f85f0101271b.html
1、卸载自身yum
# rpm -aq|grep yum|xargs rpm -e --nodeps
2、安装centos的YUM
rpm -ivh
rpm -ivh
rpm -ivh
注意后面两个是相互依赖的,所以要一起装
3、更新源
cd /etc/yum.repos.d/
新建个文件CentOS-Base.repo
vi CentOS-Base.repo
内容如下:
[base]
name=CentOS-6.2 - Base
baseurl=
gpgcheck=0
gpgkey=
#released updates
[updates]
name=CentOS-6.2 - Updates
baseurl=
gpgcheck=0
gpgkey=
#packages used/produced in the build but not released
[addons]
name=CentOS-6.2 - Addons
baseurl=
gpgcheck=0
gpgkey=
#additional packages that may be useful
[extras]
name=CentOS-6.2 - Extras
baseurl=
gpgcheck=0
gpgkey=
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.2 ¨C Plus
baseurl=
gpgcheck=0
gpgkey=
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.2 - Contrib
baseurl=
gpgcheck=0
gpgkey=
之后就OK了