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.

marked as duplicate by David Foerster, George Udosen, Eric Carvalho, waltinator, dpb Apr 22 '18 at 4:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Did you try to simply run apt-get -f install (just that, with no packages in the command line) like it's telling you to? If you run it, it should take care of installing dependencies of broken packages... – filbranden Apr 18 '18 at 5:42
  • Already tried. Still the same response. – Safdar Mirza Apr 18 '18 at 5:49
  • 1
    No currently supported version of Ubuntu has Python 2.7.5. Which version of Ubuntu is this? – muru Apr 18 '18 at 5:54
  • VERSION_ID="14.04" – Safdar Mirza Apr 18 '18 at 5:57
  • 3
    Add the output of apt-cache policy python2.7 python:i386 to the question, please. – muru Apr 18 '18 at 6:41
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.
>>> 
  • Why the downvote? – ggdx Apr 20 '18 at 8: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 8: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 9: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 9:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.