How to remove PPA repository from command line on Ubuntu

Last updated on August 4, 2020 by Dan Nanni

Question: I added a third-party PPA repository on my Ubuntu box some time ago. How can I remove the PPA repository?

A Personal Package Archives (PPA) is a Ubuntu way to allow independent developers and contributors to build and distribute any custom packages as a third-party APT repository via Launchpad. If you are a Ubuntu user, chances are that you have added popular third-party PPA repositories to your Ubuntu system. But some of those PPA repositories you have added may become obsolete later, in which case you want to remove them.

If you want to remove any pre-configured PPA repository, the following guide shows how to do it.

Suppose you have a third-party PPA repository named "ppa:webapps/preview" added on your Ubuntu system, as follows.

$ sudo add-apt-repository ppa:webapps/preview

Remove a PPA Repository

If you want to delete a PPA repository alone, run the following command.

$ sudo add-apt-repository --remove ppa:someppa/ppa

Note that the above command does not touch any packages installed or upgraded from the PPA itself.

Remove a PPA Repository and All Its Installed Packages

If you want to delete a PPA repository as well as all packages installed/upgraded from the PPA, you can use ppa-purge command.

To install ppa-purge package:

$ sudo apt-get install ppa-purge

To remove a PPA repository and all its packages from the command line:

$ sudo ppa-purge ppa:webapps/preview

These methods can be useful when you identify and purge broken PPA repositories after distro upgrade.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal (Credit Card) or Bitcoin (1M161JGAkz3oaHNvTiPFjNYkeABox8rb4g).

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean