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 situation, you first have 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 is the easiest. Go to System> Administration> Software Sources. Once there, go to the tab Other software. All the PPAs will be listed there. From this window you will also be able to disable the PPAs that cause you problems (although this, by itself, will not restore the 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 tell us anything that gives us a clue as to what it is about!).

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 3 (using the terminal) to obtain the path of the PPA necessary to uninstall it using ppa-purge, this is given by the text that is between ppa.launchpad.net y ubuntu.

For example, to:

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

the path of the PPA is: jason-scheunemann / ppa

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

sudo ppa-purge ppa: jason-scheunemann / ppa

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


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Edison galindo said

    ecxelente, thank you very much

  2.   browe1387 said

    Hello, excellent website and all its content, but I have a doubt no, it is related to your website.
    On your website, when you go down a little more, a bar is displayed in which is twitter and something else, my question is how to put that bar? It is not the first time that I see it on a website that is why my doubt, do you think you can help me? Well here I leave you an image so you know what it is.
    http://i47.tinypic.com/280l9qf.png

    Beforehand thank you very much.

  3.   browe1387 said

    Thank you very much.

  4.   Anomie said

    Delete files from /etc/apt/sources.list.d
    It automatically stops looking for those ppa when doing an apt-get update.

    1.    Angel22 said

      Very good comment is what the post lacked

  5.   Saito Mordraw said

    Excellent guide, very necessary for users who, trying things or simply exploring, fill up with PPAs that they will never use, dirtying their system.

  6.   Carlos said

    Well, I am not able to delete this repository:

    deb http://ppa.launchpad.net/ubuntu-x-swat/intel-graphics-updates/ubuntu specify main

    The most I get is to disable it, but for some reason I don't understand it tries to undo the repository changes with packages for "oneiric" instead of for "precise" and of course it fails.

    What would the command to remove that repository look like?

    1.    rac said

      Good,

      A solution "not very fine" but useful if the ppa-purge does not work for you, is to delete the file from /etc/apt/sources.list.d as an anonymous said up there or "comment" the addresses.

      If you do a

      cd /etc/apt/sources.list.d

      and then a

      ls

      you will see the files that your distribution uses to mount the repositories.

      Surely the one you want to remove is called ubuntu-x-swat.list or something like that.

      Or you delete the file with a

      sudo rm ubuntu-x-swat.list

      or you enter it and "cancel" the lines of the file with a #.

      sudo nano ubuntu-x-swat.list

      put # in front of each line of the file, Crtl + O to save, Enter to say yes and Crtl + X to exit.

      as soon as you do the

      sudo apt-get update

      o

      sudo aptitude update

      you will see that it already ignores those lines.

      I hope my "me of the present" helps someone from the future ... 😛

      1.    Josshy said

        From the package manager you give it sources of ppa software and delete the one you don't want anymore

    2.    Josshy said

      From the ubuntu software center you give it to software sources then at the top it says ppa you give it there you select the one that no more and you give it remove and voila finally you update sudo apt-get update

  7.   Vicente said

    Thanks it served me

    1.    let's use linux said

      You're welcome!!
      Hug! Paul.