Installing Python on Linux

I plan to get you started on the right foot and in doing so, I anticipate we will program a strong password generator. The very first lesson of course, is this lesson: Installing Python on Linux. In part 2 of this series, I described the the meaning behind Linux distributions, most Linux distributions come with Python installed. However, I will show you how to install Python on Debian and Fedora Linux. I chose these two distributions because they are the two major distros other systems are based on. Ubuntu, Knoppix, Linspire and others are Debian based while Fedora is RPM based just as Mandriva, SUSE and all Red Hat versions.

RPM Based Python installation
  • Boot up your favorite RPM based Linux ditro, I’m using Fedora.
  • Go to the Python for Linux RPM page at http://www.python.org/download/releases/2.4/rpms/
  • Download the Binaries for Fefora Core 3, they are i386 RPM
  • When the download is complete, open a console and go to the python-2.4.2.4….. file
  • Make sure you have root access, otherwise type the following commands
localhost:~$ su

Password: [enter your root password]

  • Type in the following command
  • rpm -1 python2.4-2.4-1pydotorg.i386.rpm
  • you should get a message, to read message
cat /var/spool/mail/root | less

  • You should be able to start Python by typing Python on the console. This command can also be used prior to installation or to see the Python version currently installed.
Debian based systems could also already be pre-installed with Python. However, if need be, installing on a Debian based system might be a little easier.
Debian Based Python installation

  • Boot up your favorite Debian based ditro, I’m running Debian 5
  • Open a console and make sure you have root access, otherwise type the following commands
localhost:~$ su

Password: [enter your root password]
  • Type in the following command
localhost:~# apt-get install python

  • Do you want to continue? [Y/n] Y

  • At this point, you should be able to start Python on the console on a Debian based system.
Although this covers a broad range of distributions, the categories of Linux distributions also include Gentoo, a portage package distro.
If you can go to a console, and  type:

python <enter>
1+1 <enter>


you should see and answer of 2, if so, you have properly installed Python on Linux and this should get you started in programming Python.
Share:

0 comments:

Post a Comment

DISCLAIMER

The information provided on hottechtips.blogspot.com is to be used for educational purposes only. The website creator is in no way responsible for any misuse of the information provided. All of the information in this website is meant to help the reader develop a hacker defense attitude in order to prevent the attacks discussed. In no way should you use the information to cause any kind of damage directly or indirectly. The word “Hack” or “Hacking” on hottechtips.blogspot.com should be regarded as “Ethical Hack” or “Ethical hacking” respectively. You implement the information given at your own risk.