Centos 5 手动安装yum

遇到2个问题

  1. 提示No module named yum ##因为yum版本不兼容需要重新安装

  2. /usr/lib/python2.4/site-packages/_sqlitecache.so: wrong ELF class: ELFCLASS32 ##因为python版本问题,

    1.解决,重装yum

    2.解决,设置vim /usr/bin/yum  将注释##!/usr/bin/python2.4


附加重装方法 重装前一定确认系统版本是 i386 还是x64切记,要不还是会提错误


首先需要确定系统

#uname -a

Linux skw 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

确认是x86_64之后,在网易的mirrors下载需要的rpm包:

http://mirrors.163.com/centos/5/os/x86_64/CentOS/

wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/m2crypto-0.16-8.el5.x86_64.rpm

wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm

wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm

wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-sqlite-1.1.7-1.2.1.x86_64.rpm

wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-urlgrabber-3.1.0-6.el5.noarch.rpm

wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm

wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm


然后 安装软件包,并导入证书

1:删除自带的yum源

[root@localhost ~]# rpm -aq|grep yum|xargs rpm -e --nodeps


或者更新 下载的rpm   

[root@localhost ~]# rpm -Uvh *

[root@localhost ~]# rpm -import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5


让yum使用网易的源:


#cd /etc/yum.repos.d/

#wget http://mirrors.163.com/.help/CentOS-Base-163.repo


编辑CentOS-Base-163.repo,在所有mirrorlist前面加上#,把所有$releasever替换成5,然后保存。


#yum clean metadata

#yum makecache


完成后yum可以正常工作,更新yum


#yum -y upgrade


你可能感兴趣的:(linux,python,yum,网易,Wrong)