Last updated on August 27, 2020 by Dan Nanni
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.
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 ‒ About ‒ Write for Us ‒ Feed ‒ Powered by DigitalOcean