Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Having exactly the same problem described on this page:

Below is directly quoted from that page:

I am unable to install python-dev becasue of unmet dependancies. How can I get around this? Deleting python is not an option and I cant got back to python2.6-dev as it cant be found.

sudo apt-get install python-dev

The following packages have unmet dependencies: python-dev : Depends: python2.7-dev (>= 2.7.3) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

So try python2.7-dev

sudo apt-get install python2.7-dev

The following packages have unmet dependencies:
python2.7-dev :
    Depends: python2.7 (= 2.7.3-0ubuntu3) but 2.7.3-0ubuntu3.1 is to be installed
    Depends: libpython2.7 (= 2.7.3-0ubuntu3) but 2.7.3-0ubuntu3.1 is to be installed
E: Unable to correct problems, you have held broken packages.

So my question is how I can solve this problem without uninstall Python? Any advice would be really appreciated!

share|improve this question
Your installed python2.7 and libpython2.7 packages may be out of date, run apt-get update; apt-get dist-upgrade first. – mgorven Mar 8 '13 at 22:46

In the end, I used Aptitude, which downgrades my Python version.

share|improve this answer

If you're not already, try changing your package repository reference to 'Main' or the United States. Doing this fixed my Python-dev unmet-dependencies problem (my 12.04 install was using the United Kingdom package repository, previously).

  1. In 'Ubuntu Software Center' (USC) go to the menu/tab 'Edit => Software Sources'.
  2. Change the 'Download from' drop-down value to 'Main Server' or a server in the United States.
  3. Leave USC, the open 'Update Manager' from Ubuntu's program menu, and 'Check' for software update (or issue 'sudo apt-get update' in a terminal window).
  4. Update your software as you normally would, e.g. via 'Update Manager' or apt-get/aptitude in a terminal.

This repaired my repository and I went on to install whatever I needed afterwards, as normal.

Before rectifying my problem with the above instructions, various aptitude/apt-get commands suggested that I remove many, many packages, but, as you can apreciate, I didn't fancy loosing my 6-months+ of package additions, and that's even though I snapshot the package list at times (see my gist for hints)! I'm really glad I found out about the instructions I'm leaving here.

Hope this helps.

share|improve this answer


deb precise-security main

deb precise-updates main

to sources.list solved it for me

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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