Unable to install python2.7-dev due to unmet dependencies Ubuntu 12.04
Solution 1
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).
- In 'Ubuntu Software Center' (USC) go to the menu/tab 'Edit => Software Sources'.
- Change the 'Download from' drop-down value to 'Main Server' or a server in the United States.
- 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).
- 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.
Solution 2
In the end, I used Aptitude, which downgrades my Python version.
Related videos on Youtube
BananaOnTheWall
Learning is about today's you beating yesterday's you.
Updated on September 18, 2022Comments
-
BananaOnTheWall over 1 year
Having exactly the same problem described on this page: http://qnundrum.com/answer.php?q=431114
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!
-
mgorven about 11 yearsYour installed
python2.7
andlibpython2.7
packages may be out of date, runapt-get update; apt-get dist-upgrade
first. -
Scott about 6 yearsI found very easy solution. Check this link: askubuntu.com/a/922325/498798
-