Ian P
Ian P

Reputation: 1533

Uninstall python built from source?

I've installed python 2.6 from source, and somehow later mistakenly installed another python 2.6 from a package manager too.

I can't find a way to uninstall a python that was built from source, is this possible/easy?

Running ubuntu 10.04.

Upvotes: 55

Views: 80668

Answers (4)

das
das

Reputation: 71

I did the following and reinstall using 'make install' and it worked.

whereis python3.6
rm -rf /usr/local/lib/python3.6
rm -rf /usr/local/bin/python3.6*
make install

Upvotes: 7

maletor
maletor

Reputation: 7122

In the future it may be prudent to use sudo checkinstall.

Upvotes: 0

unutbu
unutbu

Reputation: 879083

You can use checkinstall to remove Python. The idea is:

  1. Install checkinstall
  2. Use checkinstall to make a deb of your Python installation
  3. Use dpkg -r to remove the deb.

See this post for more details.

PS. Note that Ubuntu must always have at least one installation of Python installed, or else major pieces of your OS stop working. Above, I'm assuming it's safe to remove the Python built from source, without removing the Python that was installed by the package manager.

PPS. If you accidentally erase all Python installations from your Ubuntu machine, all is not lost. Instructions on how to recover from this situation can be found here.

Upvotes: 33

Julio
Julio

Reputation: 2290

Have you looked into make uninstall I believe this should work for you, assuming you have the python 2.6 source and the make file has uninstall available (it should).

http://www.linuxquestions.org/questions/linux-newbie-8/source-uninstall-with-make-uninstall-howto-230225/

Upvotes: 0

Related Questions