0

I installed python 3.4.4 in ubuntu 14.04, but I want to remove it.

when I open terminal and type python3.4 -V then the output is the following.

Python 3.4.4

when I installed, I referenced this web-site "i referenced this website"

I want to remove python 3.4.4 how to do? I am linux newbie please help me.

when i enter /usr/src/Python-3.4.4 directory and type make uninstall or sudo make uninstall then output message is that

make *** no rule to make target uninstall'. stop

I think that method isn't working.

박주현
  • 117
  • 2
  • 2
  • 11
  • How did you install it? – muru Mar 09 '16 at 17:22
  • I referenced this web-site http://tecadmin.net/install-python-3-4-on-ubuntu-and-linuxmint/# – 박주현 Mar 09 '16 at 17:28
  • 1
    Possible duplicate of [If I build a package from source how can I uninstall or remove completely?](http://askubuntu.com/questions/87111/if-i-build-a-package-from-source-how-can-i-uninstall-or-remove-completely) – muru Mar 09 '16 at 17:30
  • oh thank you. Could I ask one more? now in /usr/src/ directory, I have Python-3.4.4.tgz file and Python-3.4.4 directory. According to solution that you suggested, I enter Python-3.4.4 directory and need to type sudo apt-get uninstall, right?? – 박주현 Mar 09 '16 at 17:37
  • Ah, never mind. Python's Makefile doesn't have an `uninstall` option. You'll have to run `make -n altinstall`, see which files were installed and delete them manually. – muru Mar 09 '16 at 17:45
  • should I have to work in /usr/src/Python-3.4.4/ directory?? – 박주현 Mar 09 '16 at 17:50
  • Yes, run `make -n altinstall` in `/usr/src/Python-3.4.4/`. You will see a list of commands and paths. Delete all the paths that mention `python3.4`. – muru Mar 09 '16 at 17:51
  • can you teach me a little more? so many commands and paths are shown. but I don't know how remove them. I want to show you `make -n altinstall` output. do you know how to upload file? I hope i will be given how to do through some examples.. – 박주현 Mar 09 '16 at 18:08
  • 1
    **Make sure you never accidentally remove the preinstalled Python 3 version! many tools like e.g. most package managers will not work any more if you remove that.** (Just a warning to be careful when it comes to removing Pythons *before* it's too late. I already advised far too many people to reinstall their system because of that in the last weeks. :-/) – Byte Commander Mar 09 '16 at 19:17

1 Answers1

1

After running make -n altinstall and doing a bit of processing1, the relevant paths are:

/usr/local/bin/python3.4
/usr/local/include/python3.4
/usr/local/lib/libpython3.4
/usr/local/lib/python3.4
/usr/local/share/man/man1/python3.4

Some of these maybe temporary - only used during installation and deleted after finishing it. So, you might not find some of these. Delete the rest.


1 I just ran:

make -n altinstall | grep -v rm | grep -Po '/usr/local[^[:space:]]*?python3.4' | sort -u

This filters out rm commands, and then prints only the paths in /usr/local (the default location picked by ./configure) that end in python3.4 and removes duplicated entries.

muru
  • 193,181
  • 53
  • 473
  • 722