Some tools in Backtrack Linux version 5 R3 were written for older versions of Python so if you are interested in using some of these tools in can be beneficial to install older versions of Python such as Python 2.4. Below I describe how to easily install Python 2.4 without causing issues with the Python 2.6 that is installed by default on Backtrack Linux 5 R3 or Ubuntu 10.04.
Install Python 2.4 On Backtrack 5 R3:
- Download Python 2.4.4: First use cd (change directory) to change into the /usr/local/src directory as shown in the example output below. Next use wget to pull down the Python 2.4.4 source from python.org.
- root@bt:~# cd /usr/local/src/
- root@bt:/usr/local/src#
- root@bt:/usr/local/src# wget http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tgz
- --2012-12-29 21:07:38-- http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tgz
- Resolving www.python.org... 82.94.164.162, 2001:888:2000:d::a2
- Connecting to www.python.org|82.94.164.162|:80... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 9531474 (9.1M) [application/x-tar]
- Saving to: `Python-2.4.4.tgz'
- 100%[================================================>] 9,531,474 1.61M/s in 6.9s
- 2012-12-29 21:07:45 (1.32 MB/s) - `Python-2.4.4.tgz' saved [9531474/9531474]
- root@bt:/usr/local/src#
- Unpack Python 2.4.4 Source And Change Directory: Now use the tar command to unzip and unpack the Python 2.4.4 source as shown in the example below.
- root@bt:/usr/local/src# tar -zxvf Python-2.4.4.tgz
- **** once complete ***
- root@bt:/usr/local/src# cd Python-2.4.4/
- Configure And Compile Python 2.4.4 On Backtrack: Now use ./configure and make to compile the Python 2.4.4 source on Backtrack Linux like the below example output. Notice the –prefix switch used with configure so Python 2.4.4 will be install in /usr/local/python2.4.
- root@bt:/usr/local/src/Python-2.4.4# ./configure --prefix=/usr/local/python2.4
- *** once complete ***
- root@bt:/usr/local/src/Python-2.4.4# make
- Install Python 2.4.4 On Backtrack Linux: Now issue the “make install” command as shown below to install Python 2.4.4 into the /usr/local/python2.4/ directory.
- root@bt:/usr/local/src/Python-2.4.4# make install
- Link Python 2.4.4 Executable To Python2.4 In Path: After Python has completed installing use “ln -s” as shown in the below example to link the Python 2.4 python command to python2.4 as shown in the below example output.
- root@bt:/usr/local/src/Python-2.4.4# ln -s /usr/local/python2.4/bin/python /usr/bin/python2.4
- Verify Python 2.4.4 Functionality: Now run python2.4 from the command line to verify it is working properly and displaying the proper Python version.
- root@bt:~# python2.4 -V
- Python 2.4.4
- root@bt:~#
Python 2.4.4 should now be installed and functional on Backtrack 5 R3. If you want to create scripts compatible with Python 2.4.4 you can simply add “#!/usr/bin/python2.4” to the top of the script instead of “#!/usr/bin/python”. Also when executing the command use the python2.4 command instead of python such as “python2.4 python-script.py”. These same instructions should work on Ubuntu Linux 10.04 without issue.
If only all installations layout on the net was as easy st this. +1 Guys ;-)
Keep up the good work.