12

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

Aizzaac
  • 231
  • 1
    Can you restore the source/build directory and try make uninstall or the other things mentioned here? - Also for the next time, the easiest way to get custom Python versions on Ubuntu (LTS releases) is using the deadsnakes PPA in my opinion. – Byte Commander Jan 29 '20 at 22:32
  • apt will only remove packages. You used 'make altinstall' so try above comment, if it doesn't work then you'll need to manually remove all the installed files that make altinstall installed. – doug Jan 30 '20 at 02:05
  • @ByteCommander I cannot find my Trash. I do not have a /home/ubu-admin/.local/share/Trash – Aizzaac Jan 30 '20 at 15:13
  • 1
    You can probably also just download and extract the archive once more and run your same configure command again, then try to sudo make uninstall or the other ways mentioned in the link, I guess. – Byte Commander Jan 30 '20 at 15:24
  • So, do you mean to install twice Python 3.8? – Aizzaac Jan 30 '20 at 15:26
  • @ByteCommander It worked! I used METHOD 2 of this web page: https://stackoverflow.com/questions/1439950/whats-the-opposite-of-make-install-i-e-how-do-you-uninstall-a-library-in-li – Aizzaac Jan 30 '20 at 18:56

2 Answers2

9

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
drmaa
  • 303
  • 3
  • 12
1

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
Aizzaac
  • 231