The second kind of compression is better, in Linux with bzip2 compressed files relatively high, the file name is generally *.tar.bz2,
But the second version of the above http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2 this is version 2.7, is not what I want, the connection in the 2.7 to 2.6 can be down to the version you want to install.
Linux download installed source files are generally used in/usr/local/src/, SRC is the source of the abbreviation, enter the directory, with wget download the line:
This will enable the version of Linux we want to download to this machine.
2. Decompression
The downloaded package can be decompressed using the tar command, such as:
3. Compiling and installing
Linux generally installs the user installs the software to the/usr/local/xxx/, uses the Configure and make, makes installs these several commands to complete the compilation and the installation,--prefix specifies to install the destination directory, as follows:
1. Enter the python-2.6 folder
2,./configure--prefix=/usr/local/python-2.6
3. Make
4. Make install4. Detecting and setting environment variables
After the installation, we entered Python on the Linux command line, and executed the previous system's 2.4 version, which is related to the environment variables of the system.
Enter the/usr/bin/folder to see the following files: Python, Python2, pthon2.4, such as:
If we use the absolute path to execute the 2.6 version we just installed, we will run version 2.6, such as:
Switch to this directory, also found the same as the/usr/bin/directory, the same Python file,
Use Path= "$PATH":/usr/local/python-2.6/bin Add the directory to the Linux environment variable, such as:
At this point in the command line to enter Python, the system is still performing version 2.4, because the system first searched for/usr/bin/inside the python, but the input python2.6 has executed 2.6 version of the, such as:
We delete the Python file inside the/usr/bin/and then create a 2.6 symbolic link in that directory to let the system execute the 2.6 version we want, as follows:
1, cd/usr/bin/
2. Rm-rf python
3, Ln-s/usr/local/python-2.6/bin/python./pythonLet's take a look at the files in the/usr/bin/directory and enter Python to perform the version we installed, such as: