1.安装python
下载Python源码包
[[email protected] ~]# wget http://www.python.org/ftp/python/2.4.3/Python-2.4.3.tar.bz2
解压Python源码包
[[email protected] ~]# tar jxvf Python-2.4.3.tar.bz2
编译安装Python
[[email protected] ~]# cd Python-2.4.3
[[email protected] Python-2.4.3]# ./configure
checking MACHDEP... linux2
checking EXTRAPLATDIR...
checking for --without-gcc... no
checking for --with-cxx=<compiler>... no
checking for c++... c++
checking for /dev/ptmx... yes
checking for /dev/ptc... no
checking for socklen_t... yes
checking for build directories... done
configure: creating ./config.status
config.status: creating Makefile.pre
config.status: creating Modules/Setup.config
config.status: creating pyconfig.h
creating Setup
creating Setup.local
creating Makefile
[[email protected] Python-2.4.3]# make
[[email protected] Python-2.4.3]# make install
running install_scripts
copying build/scripts-2.4/smtpd.py -> /usr/local/bin
copying build/scripts-2.4/pydoc -> /usr/local/bin
copying build/scripts-2.4/idle -> /usr/local/bin
changing mode of /usr/local/bin/smtpd.py to 755
changing mode of /usr/local/bin/pydoc to 755
changing mode of /usr/local/bin/idle to 755
if test -f /usr/local/bin/python -o -h /usr/local/bin/python; \
then rm -f /usr/local/bin/python; \
else true; \
fi
(cd /usr/local/bin; ln python2.4 python)
Creating directory /usr/local/man
Creating directory /usr/local/man/man1
/usr/bin/install -c -m 644 ./Misc/python.man \
/usr/local/man/man1/python.1
2.下载并安装python-urlgrabber,python-pycurl,yum-metadata-parser
[[email protected] ~] wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-urlgrabber-3.9.1-8.el6.noarch.rpm
[[email protected] ~] wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-pycurl-7.19.0-8.el6.x86_64.rpm
[[email protected] ~] wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[[email protected] ~] rpm -ivh python-urlgrabber-3.9.1-8.el6.noarch.rpm python-pycurl-7.19.0-8.el6.x86_64.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm