0

I'm on Ubuntu 22.04.1 which comes whit its own python3.11 and have just installed an alternative python version (3.7.9 ) from source (I'm not able to use apt for this python version), doing the following

cd usr/lib
sudo wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
sudo tar xzf Python-3.7.9.tg
cd Python-3.7.9
sudo ./configure --enable-optimizations
sudo make altinstall

The executable (python3.7 file) was correctly installed in /usr/local/bin (I found this path running which python3.7), where also other files were installed (es. 2to3-3.7; easy_install-3.7 ; idle3.7; pip3.7 ; pydoc3.7; python3.7m-config; python3.7m; pyvenv-3.7). A file called python3.7 was also installed in /usr/local/lib. Of course there is also a file called python3.7.9 in /urs/lib. Sincerely I don't know if other files were installed and were.

I want to delete this python installation: do I have to do it manually or there exists a simpler way? I would add that I don't have a make uninstall option. I also tried make clean and make distclean but nothing happened (the above-mentioned files are still present and python3.7 is still working).

If there isn't an intelligent way to uninstall, is it sufficient to manually delete python3.7 related files from /usr/local/bin, /usr/local/lib, /urs/lib or am I missing something?

Thanks

user17788510
  • 158
  • 1
  • 8
  • If you regularly run `make install` learn to use [`checkinstall`](https://stackoverflow.com/a/14516283/7976758). See [tag:checkinstall] and https://stackoverflow.com/search?q=%22make+install%22+uninstall – phd Nov 25 '22 at 21:32
  • 1
    If you already ran `make install` without `checkinstall` — there is no good way to uninstall, it is sufficient to manually delete binaries and libs. – phd Nov 25 '22 at 21:34
  • 1
    For what it's worth, the conventional meaning of `make clean` is to clean the _source_ directory by removing files which can be easily remade, and `distclean` the same without "easily" i.e. restore to the pristine sources and nothing else. – tripleee Nov 26 '22 at 10:03
  • 2
    As another tangential remark, the "deadsnakes" PPA contains earlier Python versions for easy installation (and possible subsequent uninstallation) via Apt. You might also want to look at `pyenv` which lets you keep multiple Python versions installed in parallel and switch easily between them. – tripleee Nov 26 '22 at 10:06
  • thank you both. I uninstalled it manually and for the future I guess I will use deadsnakes PPA (it makes python (un)installation management easy, although checkinstall is a valid alternative) – user17788510 Nov 28 '22 at 10:46

0 Answers0