How to get a list of all installed repositories and PPAs on Ubuntu

Last updated on August 27, 2020 by Dan Nanni

Question: I configured so many third-party repositories and PPAs on my Ubuntu system that I lost their count. How can I get a list of all repositories and PPAs configured on my Ubuntu?

To view all available repositories and PPAs configured on Ubuntu, you can use apt-cache command. This command is typically used to query local APT package cache to obtain various package/repository related meta data.

In particular, used with policy option, apt-cache command retrieves priorities associated with each repository resource. From its output, you can infer a list of all available repositories and PPAs.

For example:

$ apt-cache policy

The above output shows a list of repository sources and their priorities (first column). This output lists duplicate sources (e.g., for 32-bit and 64-bit packages).

To discount the duplicates and get a more human-readable list of repositories, you can refine the above output as follows.

$ apt-cache policy | grep http | awk '{print $2 $3}' | sort -u

As exemplified above, the repository list includes third party repositories, PPAs and base repositories.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

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