Since FC6 ships with Python 2.4, you’re a bit stuck if you want to play with the new features of Python 2.5. Here’s a quick and easy way to build and install a cleanly-packaged version of Python 2.5 for FC6. First, you must ensure that you have a sufficient development environment available. Fortunately, you can do this in one step. Note: this is the only command you’ll need to run with root privileges until the time comes for you to install the Python RPM that you’ve built.
$ sudo yum install autoconf bzip2-devel db4-devel \ expat-devel findutils gcc-c++ gdbm-devel glibc-devel gmp-devel \ libGL-devel libX11-devel libtermcap-devel ncurses-devel \ openssl-devel pkgconfig readline-devel sqlite-devel tar \ tix-devel tk-devel zlib-devel (That's one long line of input.) This will trundle along for a few minutes, after which you'll have all of the bits you need installed. Except for Python itself, that is. Simply grab this, in source RPM form, from your nearest friendly Rawhide repository.
lftp ftp://mirrors.kernel.org/fedora/core/development/source/SRPMS mget python-2*.src.rpm Next, install the Python source RPM into a temporary build directory of your choice. In this example, I'll use "/tmp/mypy".
mkdir -p /tmp/mypy/{BUILD,RPMS,SOURCES,SPECS} rpm --define '_topdir /tmp' -ivh python-2*.src.rpm Now you'll need to go into the SOURCES directory and frob a single file:
cd /tmp/mypy/SOURCES sed -ie 's/DBLIBVER=4.5/DBLIBVER=4.3/' python-2.5-config.patch This tells the bsddb module to link against Berkeley DB 4.3 (the default on FC6), rather than 4.5 (which will presumably ship with Fedora 7). The next step is to build the Python RPM.
cd /tmp/mypy/SPECS rpmbuild --define '_topdir /tmp/mypy' --define '__python_ver 25' -bb python.spec This takes just a few minutes on my laptop, so it shouldn't take long for you, either. Once you're done, the binary RPMs will be present somewhere under /tmp/mypy/RPMS. On a 32-bit x86 machine, they'll be in the i386 subdirectory, and on an x86\_64 machine, they'll be in the x86\_64 subdirectory. You'll have to become root to install them:
sudo rpm -ivh /tmp/mypy/RPMS/*/*.rpm A nice aspect of this way of building is that the packages it builds
should not conflict with the system’s default Python, so you ought not to have any peculiar explosions in one of the many system packages that expect a specific Python version. Your new “python” package will be named “python25”, for example, and the interpreter will be named “python25”, too.