Como devo atualizar o Python no CentOS 5.5 (64 bits)?

1

Acredito que estou executando o CentOS 5.5 (64 bits) no CA AppLogic 3.0.

uname -a diz

Linux LINUX64 2.6.18-194.32.1.el5xen #1 SMP Wed Jan 5 18:44:24 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

Eu tenho uma atualização com yum upgrade , mas meu Python ainda está na versão 2.4.3.

yum info python diz

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.5ninesolutions.com
 * extras: mirrors.cmich.edu
 * updates: mirror.5ninesolutions.com
Installed Packages
Name       : python
Arch       : x86_64
Version    : 2.4.3
Release    : 46.el5
Size       : 72 k
Repo       : installed
Summary    : An interpreted, interactive, object-oriented programming language.
URL        : http://www.python.org/
License    : PSF - see LICENSE
Description: Python is an interpreted, interactive, object-oriented programming
           : language often compared to Tcl, Perl, Scheme or Java. Python
           : includes modules, classes, exceptions, very high level dynamic data
           : types and dynamic typing. Python supports interfaces to many system
           : calls and libraries, as well as to various windowing systems (X11,
           : Motif, Tk, Mac and MFC).
           :
           : Programmers can write new built-in modules for Python in C or C++.
           : Python can be used as an extension language for applications that
           : need a programmable interface. This package contains most of the
           : standard Python modules, as well as modules for interfacing to the
           : Tix widget set for Tk and RPM.
           :
           : Note that documentation for Python is provided in the python-docs
           : package.

Acho que li uma vez em algum lugar que yum depende de python , então não devo remover isso. Então devo baixar python versão 2.7.x como uma fonte e compilá-lo? Ou existe uma maneira de atualizar o Python com yum (de alguma forma)?

Estou planejando usar a última versão 2.x do Python para Django.

    
por hobbes3 24.03.2012 / 08:18

2 respostas

3

python26 do pacote disponível em epel repo . Deve ser melhor e mais fácil opção, em seguida, instalar manualmente.

No entanto, note que você provavelmente não será capaz de substituir o padrão python com o 2.6 ou qualquer outra versão, pois há um monte de coisas construídas para o 2.4 e atualizá-lo exigiria que você reconstruísse muitos pacotes e O sistema resultante não seria realmente o CentOS 5. Eu acho que é mais fácil atualizar para o CentOS 6 e então reconstruir tantos pacotes.

    
por 24.03.2012 / 10:03
2

Sim, compile a partir da fonte:

yum install gcc gcc-c++.x86_64 compat-gcc-34-c++.x86_64 openssl-devel.x86_64 zlib*.x86_64

instale o python 2.7

wget http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2
tar -xvjf Python-2.7.tar.bz2
cd Python*
./configure --prefix=/opt/python27
make
make install
vi ~/.bash_profile

replace PATH=$PATH:$HOME/bin
with PATH=$PATH:$HOME/bin:/opt/python27/bin

recarregue .bash_profile

source ~/.bash_profile
echo "/opt/python27/lib" > /etc/ld.so.conf.d/python27.conf
ldconfig
    
por 24.03.2012 / 08:31