Software & AppsOperating SystemLinux

How To Uninstall Python 3.8 from Ubuntu After Deleting the Folder

Ubuntu 19

In this article, we will provide a detailed guide on how to uninstall Python 3.8 from Ubuntu after deleting the folder. The process involves using terminal commands and manually removing installed files.

Quick Answer

To uninstall Python 3.8 from Ubuntu after deleting the folder, you can try using the "make uninstall" command if you still have the source/build directory. If that doesn’t work, you will need to manually remove the installed files and directories. However, if you have already deleted the source/build directory and don’t have a backup, it may not be possible to uninstall Python 3.8 completely.

Introduction

Python is a popular programming language that comes pre-installed with Ubuntu. However, you might have installed a different version of Python, like Python 3.8, for specific needs. If you no longer need this version and have accidentally deleted the folder Python-3.8.0, you might be wondering how to uninstall it. This article will guide you through the process.

Method 1: Using make uninstall

If you have the source/build directory, you can use the make uninstall command to uninstall Python 3.8. Here’s how:

  1. Open your terminal.
  2. Navigate to the source/build directory using the cd command. For example, if your directory is in the home folder, you would use cd ~/python-3.8.0.
  3. Run the command sudo make uninstall.

The sudo command is used to execute the following command with superuser privileges, while make uninstall is a command that uninstalls the software.

However, this method may not work if you have already deleted the source/build directory.

Method 2: Manually Removing Installed Files

Since you used make altinstall, which doesn’t create a package, you’ll need to manually remove the installed files. Here’s how:

  1. Identify the files and directories installed by Python 3.8. You can refer to the output of the make altinstall command or search for files related to Python 3.8.
  2. Use the sudo rm command to delete the identified files and directories. For example, sudo rm -r /usr/local/lib/python3.8 would remove the Python 3.8 library.

The rm command is used to remove files or directories, and the -r option is used to remove directories and their contents recursively.

Please be cautious while using sudo rm as it permanently deletes files and directories.

Reinstalling Python 3.8

If the above methods don’t work or you encounter any issues, you can consider reinstalling Python 3.8 using the same procedure and then using one of the uninstallation methods mentioned above.

Future Considerations

Removing Python 3.8 should not cause any major issues as long as you have the default Python 3.5.2 installed. However, it’s always a good practice to backup important files and configurations before making any changes to your system.

In the future, you can consider using the deadsnakes PPA to install custom Python versions on Ubuntu, as it provides an easier and more manageable way to handle different Python versions.

Conclusion

Uninstalling Python 3.8 from Ubuntu after deleting the folder can be a bit tricky, but with the right steps, it’s certainly doable. Whether you’re using the make uninstall command or manually removing installed files, always remember to proceed with caution to avoid deleting important files or directories.

Can I uninstall Python 3.8 if I have already deleted the Python-3.8.0 folder?

Yes, you can uninstall Python 3.8 even if you have already deleted the Python-3.8.0 folder. Method 2 in the article explains how to manually remove the installed files.

What is the purpose of the `make uninstall` command?

The make uninstall command is used to uninstall software that was installed using the make install command during the build process. It removes the installed files and directories.

Can I reinstall Python 3.8 after uninstalling it?

Yes, you can reinstall Python 3.8 using the same procedure mentioned in the article. If you encounter any issues during the uninstallation process, reinstalling Python 3.8 and then using one of the uninstallation methods mentioned can be a solution.

Will uninstalling Python 3.8 cause any issues?

Uninstalling Python 3.8 should not cause any major issues as long as you have the default Python 3.5.2 installed. However, it’s always a good practice to backup important files and configurations before making any changes to your system.

Is there an easier way to manage different Python versions on Ubuntu?

Yes, you can consider using the deadsnakes PPA (Personal Package Archive) to install custom Python versions on Ubuntu. It provides an easier and more manageable way to handle different Python versions. You can find more information about it in the article.

Leave a Comment

Your email address will not be published. Required fields are marked *