How to download, compile, and install Python on Ubuntu/Debian/ CentOS Linux
Python is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.
Please use md5 checksum to make sure the downloaded files are not corrupt. Also, $ before commands mean you can run the command as ordinary user and # means you have to run the command as root (or use $ sudo
$ wget http://www.python.org/ftp/python/2.7/Python-2.7.tgz $ tar xzf Python-2.7.tgz $ cd Python-2.7 $ ./configure --with-pth --with-dec-threads --with-signal-module --prefix=/opt/python-2.7 $ make # make install
This should insall Python 2.7 in /opt/python-2.7. I symlinked /opt/python to /opt/python-2.7/ to make it the default Python installation on my machine.
Please feel free to use the comments form below if you have any questions or need more explanation on anything. I recommend thoroughy testing on a production-like test system first before moving to production. Use the icons below to share this tutorial with your friends.