0
$ sudo apt-get install python2.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:

The following packages have unmet dependencies:
python:i386 : Depends: python2.7:i386 (>= 2.7.5-1~) but it is not going to be installed
              Depends: python-minimal:i386 (= 2.7.5-5ubuntu3) but it is not going to be installed
              Depends: libpython-stdlib:i386 (= 2.7.5-5ubuntu3) but it is not going to be installed
python2.7 :   Depends: python2.7-minimal (= 2.7.12-1~trusty1) but it is not going to be installed
              Depends: libpython2.7-stdlib (= 2.7.12-1~trusty1) but it is not going to be installed

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Earlier I had used sudo apt-get autoremove 'python.*' command and now I am getting installation and dependencies issues while downloading Python 2.7.

I need to download Python 2.7.

David Foerster
  • 36,264
  • 56
  • 94
  • 147

1 Answers1

0

For the more technical, you could build your own from source.

1 - Download and extract v2.7.6 - https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz

wget https://www.python.org/ftp/python/2.7.5/Python-2.7.6.tar.xz && tar -xJvf Python-2.7.6.tar.xz

2 - Move into the dir

cd Python-2.7.6

3 - Configure

./configure

4 - Make & install

make && sudo make install

5 - Check

python command should bring up a prompt containing something like

Python 2.7.6 (default, Nov 23 2017, 15:49:48) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
ggdx
  • 109
  • Why the downvote? – ggdx Apr 20 '18 at 08:57
  • It would be far better to resolve the package dependency issues (since they're going to be in the way of all future package management operations) and use Python 2.7 from the repositories. Adding another Python installation from source just adds a new layer of insanity. -1 – David Foerster Apr 20 '18 at 08:58
  • Adding another Python installation from source just adds a new layer of insanity - How so? The OP stated I need to download Python 2.7. This works. I completely disagree this deserves a downvote. There is a reason that you can install from source and Linux is by definition open to extension by user whim providing you put the effort in. – ggdx Apr 20 '18 at 09:01
  • That something is possible and leads to a working solution for a particular (narrow-sighted) use case is insufficient for a sane and easy to maintain system set-up. It's your prerogative to disagree with my opinion just like it is mine to down-vote your answer. – David Foerster Apr 20 '18 at 09:11