Ubuntu – How to uninstall python 3.8 from Ubuntu after deleting the folder Python-3.8.0 using “rm -rf”

python3

I have a VM with Ubuntu 16.04.6 LTS. It has by default Python 3.5.2

And, I have installed Python 3.8 following the following procedure:

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

As I will install miniconda and I want to avoid any conflicts, I would like to know how to uninstall it.

So far I have tried:

sudo apt-get purge python3.8        AND

sudo apt-get --purge remove python3.8

And finally I have just deleted the folder which contained it, by mistake 🙁

But I still have it. Check the image.

enter image description here

Is it possible to uninstall it? Will I have any problems in the future?

Thank you

Best Answer

I reinstalled the package using the same procedure:

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

And added these lines:

sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
sudo make altinstall

Then I used METHOD 2 of this webpage: https://stackoverflow.com/questions/1439950/whats-the-opposite-of-make-install-i-e-how-do-you-uninstall-a-library-in-li

But I made some modifications.

sudo apt -y install checkinstall
sudo checkinstall

I said "no" to ALL the questions. And then I used this command:

dpkg -r python

FINAL RESULT

enter image description here

I deleted the Python3.8 folder:

sudo rm -rf Python-3.8.0
Related Question