Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

This question already has an answer here:

I think I may have botched my system. I have recently installed Ubuntu 14.04 on my computer.

One of the first things I did was install python 3.3 from source (using make altinstall); but then I realized that python 3.4 is already native in Ubuntu 14.04 and decided to remove the python 3.3 installation. To do that, I followed the instructions on this post.

Unfortunately, only too late did I realize that this resulted in the creation a .deb file containing a package named "python", which was subsequently installed. This had the effect of completely mangling my package system. Any attempt to use apt-get produces many dependency errors like the one below:

mercurial : Depends: python (>= 2.7) but it is not going to be installed
            Depends: python (< 2.8) but it is not going to be installed

I tried to remove the custom package by running dpkg -r python_3.3.5-1_amd64.deb but it says that I need to remove by the name of the package, not the name of the file. And running dpkg -r python also fails:

dpkg: dependency problems prevent removal of python:
 python-ubuntu-sso-client depends on python (>= 2.7).
 python-ubuntu-sso-client depends on python (<< 2.8).

The first solution I came up with was to completely re-install Ubuntu, but before I go ahead with that drastic solution, is there any way I can undo the effects of installing this custom "python" package?

Can I somehow use the .deb file to remove the package from the system (e.g. by removing the file sit provides and then resolving the dependencies by hand)? Or did this "python"-named package mess up the packages beyond hope of recovery?

share|improve this question

marked as duplicate by belacqua, Warren Hill, Eric Carvalho, BuZZ-dEE, Sneetsher May 24 '14 at 15:37

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.

I think I have found the answer. I downloaded the real "python" package from and installed it with dpkg. This seems to have solved the issue! – jdferreira May 22 '14 at 19:45
This is not a duplicate of that question, more of a very specific mistake that spawned from the fact that I installed a package with the same name as one of Ubuntu's original packages. – jdferreira May 22 '14 at 23:35

I think I have found the answer. I downloaded the real "python" package from Ubuntu Packages and installed it:

cd /tmp
sudo dpkg -i python_2.7.5-5ubuntu3_amd64.deb

To complete the whole process, I ended up recreating my custom .deb file (with python3.3) with a new non-clashing name ("python-to-remove"), and then installed and uninstalled it:

sudo dpkg -i python-to-remove_3.3.5-1_amd64.deb
sudo dpkg -r python-to-remove

This removed all the files from this package, while the files from other packages seem to not have been affected. I ended up deleting a bunch of documentation files as well, but I had never used them before, so I think I'm OK with that.

share|improve this answer

Try to do what dpkg ask you, I mean:

dpkg -r python_3.3.5-1

Use the package name, not the file one.

This is quite a wild shot, so feel free to downvote it if it doesn't work.

share|improve this answer
I have solved the problem in another way and, as it happens, I can't try offered solutions. But I suspect it wouldn't work. At least, I remember that tab-completion wasn't finding any package with that name. – jdferreira May 23 '14 at 8:37

python is by far one of the most important packages to Ubuntu. DO NOT TRY TO REMOVE IT!!! YOUR COMPUTER WILL NOT RUN PROPERLY AT ALL!!! You must reinstall ubuntu. Besides, you would not need to remove the python package anyway, why would you? It is impossible anyway.

share|improve this answer
I know that, that's why I was extra careful not to do anything wrong after the mistake. As I said in a comment (it seems I can't answer my own question, reputation points are not enough), I solved the issue quite cleanly by re-installing Ubuntu's original "python" package after manually downloading the .deb file – jdferreira May 22 '14 at 23:33
Downvote: He can try a couple of things before reinstalling. That doesn't mean that reinstalling couldn't be the easier but anyway I find that your answer is wrong. – Javier Rivera May 23 '14 at 7:12

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