If you’ve added a PPA and run into a nasty bug in your updated software, you should revert back to the Ubuntu repositories. Doing it safely can be tricky — fortunately Ubuntu Tweak can do this for us.

Remove Unwanted Packages

There are a few issues involved in removing a PPA. The simplest is to remove any packages that were provided solely by that PPA.

For example, if we tried out the beta version of Firefox 4.0, we should remove all of the firefox-4.0 packages before removing the Firefox nightly builds PPA. To do this, we’ll open up a terminal (Applications > Accessories > Terminal or Ctrl+Alt+T) and type in the following command.

sudo apt-get remove firefox-4.0*

The exact command will depend on the packages you need to remove. If you don’t remember all of the packages provided by a certain PPA, the best thing to do is to visit the PPA’s Launchpad page and look at the packages it provides.

Downgrade Updated Packages

Ubuntu Tweak offers an easy way to downgrade any packages that the PPA upgraded — and even if you don’t need to downgrade, we recommend following the steps in this section because it will also disable the PPA.

The first step is to install Ubuntu Tweak if you don’t already have it installed. Ubuntu Tweak isn’t in the Ubuntu repositories, but fortunately it has its own PPA: ppa:tualatrix/ppa. You call follow our more detailed guide to adding new PPAs, or simply open a terminal and type in the following commands.

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

Once installed, you can find Ubuntu Tweak in the Applications > System Tools menu.

Open Ubuntu Tweak, and select Package Cleaner in the list on the left.

Click on the Purge PPAs button near the right. If the list of PPAs is greyed out, click on the Unlock button and enter your administrator password.

Select the PPAs you want to remove by clicking on the checkbox next to them. Click the Cleanup button when you’re done.

You’ll be prompted to downgrade packages that have earlier versions in the Ubuntu repositories. In our case, we are removing the PPA that contains nightly builds of Mozilla Firefox.

Click Yes and Ubuntu Tweak will do the downgrade for you.

If you want to return your system to the same state that it was before installing the PPA, you can use Ubuntu Tweak to remove its own PPA, and then apt-get remove ubuntu-tweak. However, we recommend keeping Ubuntu Tweak around for all the other neat things it does!