How to list and remove PPA repository on Ubuntu 20.04 Linux

List, Add, Remove- PPA -Repository

As you probably know, tons of software can be installed in Ubuntu 20.04 right from the command line via apt or from the Ubuntu Software application on Ubuntu’s desktop. The way this works is that Ubuntu will query a repository that contains links to the various software you may wish to install. It searches for the package you specify, and then downloads and installs it.

Although Ubuntu’s default package archive contains some of the most common software people need, a lot of times it’s necessary to install a package using a PPA repository. No problem there, except these PPA repositories, don’t remove themselves unless you do it manually. After a while, your system could be querying a lot of irrelevant PPA repositories every time you install or update software. In this guide, we’ll show you how to list and delete the PPA repositories on Ubuntu 20.04 Focal Fossa.

In this tutorial you will learn:

  • How to list PPA repositories via command line
  • How to remove PPA repositories via command line
  • How to list and remove PPA repositories via GUI
Listing PPA repositories on Ubuntu 20.04
CategoryRequirements, Conventions or Software Version Used
SystemInstalled Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
SoftwareN/A
OtherPrivileged access to your Linux system as root or via the sudo command.
Conventions# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

List PPA repositories via command line

You can list all of the available repositories on a Ubuntu 20.04 system by opening a terminal and typing the following command:

sudo apt policy

We have one PPA repository on our system, which is for Java. The apt policy  command will output PPA repositories first, so look at the beginning of the output to see all of the PPA repositories on your system. Listed below the PPA repositories are just the default package archives that Ubuntu always uses.

apt policy lists the Java PPA on our system
apt policy lists the Java PPA on our system

Remove PPA repository via command line

Once you determine the name of a PPA repository with apt policy that you wish to remove, you can use the following command syntax to get rid of it:

sudo add-apt-repository --remove ppa:PPA_REPOSITORY_NAME/PPA

The Java repository on our system is linuxuprising/java, so we’d remove it with this command:

sudo add-apt-repository --remove ppa:linuxuprising/java

After issuing the remove command, you can check  apt policy to make sure the PPA no longer appears in the list.

02-how-to-list-and-remove-ppa-repository-on-ubuntu-20-04-focal-fossa-linux.png (1439×897)
The PPA repository has been removed from our system


List and remove PPA repository via GUI

If you have access to a GUI on your Ubuntu 20.04 system, then this method is even easier. To list and remove PPA repositories via GUI, first open the Software & Updates application from Ubuntu’s application launcher.

03-how-to-list-and-remove-ppa-repository-on-ubuntu-20-04-focal-fossa-linux.png (1439×897)
Open the Software & Updates application

Click on the “Other Software” tab to get a list of the PPA repositories. Like before, the only PPA repository we have on our system is for Java: The Software & Updates app shows us what PPA repositories our system has

To remove a PPA repository, all you need to do is highlight a listed PPA and click remove.

Removing a PPA repository via GUI
Removing a PPA repository via GUI

That’s all there is to it. You can close the Software & Updates application when you are finished, and the changes will be saved on your system.

Conclusion

In this article, we learned how to list and remove PPA repositories via command line or GUI on Ubuntu 20.04 Focal Fossa. Removing irrelevant PPA repositories from your system is good practice, as it prevents your package manager from becoming convoluted with unnecessary package archives.

Related Linux Tutorials: