Ubuntu – I think a PPA update broke the system. What can I do

package-managementppa

A few weeks ago I installed ppa:ricotz/testing on Ubuntu 11.10. It worked fine then, but since a recent upgrade, trying to launch GTK applications results in lots of cryptic errors.

Can I revert all packages updated by ppa:ricotz/testing to the versions in the main Ubuntu repositories?

Best Answer

Yes. Assuming the PPA hasn't borked essential components of your system (like network connection, package management, and boot) it should be possible to restore your system to mainline Ubuntu packages.

Getting into a repair environment

First, get to a command-line. If your system is still usable enough to login and use an Ubuntu session, launch 'Terminal'. If not, press Ctrl-Alt-F1 (Ctrl-Alt-Fn-F1 if you have media keys), and login to the text prompt.

Resolving package inconsistencies, if any

Now. First, finish any incomplete updates that may have been interrupted.

sudo dpkg --configure -a

If this repairs anything, it's possible no further repairs will be necessary; simply skip to the Finishing up step below. If nothing is repaired, the package integrity of your system is good, and PPAs may indeed be resposible.

Installing a PPA removal tool

First install ppa-purge...

sudo apt-get install ppa-purge

If you're using Ubuntu 10.04, you need to add lucid-backports to your software sources.

Removing potentially damaging PPAs

And then uninstall PPAs from your system like so, replacing ricotz/testing with the PPA you want to remove:

sudo ppa-purge ppa:ricotz/testing

(If you do not know what PPAs you have installed, you can check with cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep ppa. The PPA names correspond the unique portion of the URLs, such as ricotz/testing for ppa.launchpad.net/ricotz/testing/ubuntu/)

Finishing up

Finally, update your system and restart.

sudo apt-get update && sudo apt-get upgrade
sudo shutdown -r now

Hopefully you will reboot into a fixed Ubuntu.