How to Uninstall Python 3.8 from Ubuntu After Deleting the Folder Python-3.8.0 Using "Rm -Rf"?

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 
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.

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

Thank you

6

2 Answers

I got python3.8 when I did apt-get update on ubuntu 20.

These two steps removed it for me.

sudo apt-get -y purge python3.8
sudo apt-get -y autoremove

In Dockerfile you have to remove sudo.

apt-get -y purge python3.8
apt-get -y autoremove

I reinstalled the package using the same procedure:

wget 
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:

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

I deleted the Python3.8 folder:

sudo rm -rf Python-3.8.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest