How to delete PPA on Ubuntu-based distributions

Personal Package Archives (PPA) are awesome. But from time to time, you will want to eliminate a PPA for several reasons. How you do this depends on what you want to achieve.

Personal Package Archives (PPA) are awesome. You receive new software or programs that are missing in the default distribution repository. But from time to time, you will want to eliminate a PPA for several reasons. How you do this depends on what you want to achieve. Usually, you will find yourself in either of the following:

  1. You want to remove PPA from the software source list and remove the installed packages.
  2. You want to remove PPA from your software source list and revert to the default packages provided by the distribution.

Let's explore the first scenario!

Remove PPA and its packages

Make sure you have the 'add-apt-repository' utility installed . This utility should be available, by default, on most Ubuntu-based distributions, but to be sure, run the following command.

 sudo apt install software-properties-common 

Next, you need the exact name of the PPA you want to remove. If you forget it, you can search on Google, open the Launchpad page where it is stored and find installation instructions. There, you will find the exact name of PPA (e.g. 'ppa: libreoffice / ppa' ).

Picture 1 of How to delete PPA on Ubuntu-based distributions

Alternatively, instead of searching the web, you can search your software source list to see which PPAs are currently active.

 grep -r -i ppa /etc/apt/ 

Picture 2 of How to delete PPA on Ubuntu-based distributions

Next, you can open any link starting with http://ppa.launchpad.net and find the exact PPA name you need.

Replace 'NAME_OF_PPA' in the next command with the actual name you found earlier. For example, the final command might look like this: sudo add-apt-repository --remove ppa:libreoffice/ppa .

 sudo add-apt-repository --remove NAME_OF_PPA 

Refresh the package manager information.

 sudo apt update 

Finally, remove the package and its dependencies with:

 sudo apt autoremove NAME_OF_PACKAGE 

After you enter this command, pay attention to the list of packages to be deleted. If you see something you need on this list, then use apt's remove option (instead of autoremove ):

 sudo apt remove NAME_OF_PACKAGE 

Find all installed packages from PPA

If the autoremove option doesn't seem to be able to uninstall all packages that come from that PPA, you may have to delete them manually.

Install the following utilities.

 sudo apt install apt-forktracer 

Now, you can find all packages installed on the system coming from PPA.

 apt-forktracer | grep -i ppa | awk '{print $1}' 

Next, you can delete them with sudo apt remove or sudo apt autoremove . autoremove will try to automatically uninstall the package (s) you specify, plus all dependencies. remove will only uninstall the package (s) you specify.

If you are sure you can delete all packages shown previously by apt-forktracer , you can use the following command:

 sudo apt remove $(apt-forktracer | grep -i ppa | awk '{print $1}') 

Be sure to double check what will be deleted so you don't accidentally uninstall something you need.

Delete the PPA package and revert to the default versions of the distribution

As in the previous section, you first need to know the exact name of the PPA. If you don't know, try the methods above.

Install ppa-purge .

 sudo apt install ppa-purge 

Run the ppa-purge script . This script will remove PPA from your software repository and replace installed PPA packages with the default distribution packages. Of course, this requires your Linux distribution to have these packages available. In most cases, this means that the new software will be downgraded to older versions.

 sudo ppa-purge NAME_OF_PPA 

Example command:

 sudo ppa-purge ppa:libreoffice/ppa 

On 'clean' systems, the above commands will run without any problems. However, on other systems, you may encounter some conflicts due to incompatible packages. Unfortunately, there is no general solution, because that depends on the particular situation you encounter.

Most of the cases can be solved by deleting, downgrading or upgrading some of them. To avoid such experience in the future, read the article: Do not damage the Debian system! to learn how to keep your operating system 'clean'.

Hope you are succesful.

Update 10 October 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile