PPA Purge: How to Safely Remove a PPA Repository

The PPAs allow users to install applications that are not present or are not sufficiently updated in the official Ubuntu repository, since those who administer these repositories take a reasonable time to make the updates of the programs "official" in order to improve the stability and security of the system.

Luckily, in Ubuntu we have the PPAs to exceed this "measure", which although it is very appropriate from the point of view of Ubuntu developers, it may not be so much from the point of view of the end user who always wants to have the latest "chiche" and the latest version of the programs. The downside to this method is that by adding PPAs we increase the risks of system instability and open significant security gaps.

These are precisely the reasons why it may be necessary to remove a PPA repository that you have previously added.

PPA-PURGE to the rescue

ppa-purge is a script that will remove the indicated PPA from your sources.list as well as all packages installed from it. Finally, it will reinstall the "official" versions of the programs that you have updated through the PPA. In a word, it is a way to restore your system to the previous point when adding the PPA.

How to use

The problem arose when you typed this in a terminal:

sudo add-apt-repository ppa: my_ppa

When executing this line what you did was add a PPA to your list of repositories from which Ubuntu will install and update the available applications.

To undo this, you first need to install PPA-PURGE. You can download the DEB package from here.

Once installed, I opened a terminal and wrote:

sudo ppa-purge ppa: my_ppa / subdirectory /

If you have previously added the entire PPA, you only have to enter the name of the PPA, otherwise you must also enter the specific subdirectory.

So, for example, these would be the pairs to install and uninstall a PPA:

sudo add-apt-repository ppa: chromium-daily
sudo ppa-purge ppa: chromium-daily

sudo add-apt-repository ppa: tualatrix / gloobus
sudo ppa-purge ppa: tualatrix / gloobus

In the first example, we had installed the complete PPA and in the second only one directory. When using ppa-purge, obviously, we must specify the same path that we had used with add-apt-repository.

Hopefully the improved Ubuntu Software Center that will come with Ubuntu 10.10 incorporates the ability to add and / or remove PPAs. For now, we must settle for this method, which in my experience is the safest and most reliable.

How to list currently used PPAs

You probably don't remember what the hell was the name of that damn PPA that's causing you trouble. There are basically 3 ways to find out the PPAs that your sources.list is currently using.

The first method is the easiest. Go to System > Administration > Software Sources . Once there, go to the Other Software tab . All PPAs will be listed there. From this window, you can also disable PPAs that are causing problems (although this alone won't restore previous versions of the programs). You can also add a "comment" to each PPA to make it easier to identify (of course, sometimes the PPA path doesn't give us any clues as to what it is!).

You can also access a list of PPAs by going to Applications> Ubuntu Software Center. However, from there you will not be able to disable the PPAs, just view / install / uninstall the applications available through those PPAs.

The third method is to use the terminal. We wrote:

grep -i ppa.launchpad.net /etc/apt/sources.list.d/*.list

This is, in my view, the best way to see which are the PPAs installed in the system.

Remember that if you are going to use method 1 (through Software Sources) or method 3 (using the terminal) to obtain the path of the PPA needed to uninstall it using ppa-purge, this is given by the text found between ppa.launchpad.net and ubuntu.

For example, to:

http://ppa.launchpad.net/jason-scheunemann/ppa/ubuntu

The PPA route is: jason-scheunemann/ppa

So, in ppa-purge you are going to put:

sudo ppa-purge ppa: jason-scheunemann / ppa

For your reference, it's good to know that, generally, the structure of PPA paths is as follows: username/ppa_name.


Add as preferred source in Google