Read more

HowTo: List packages in an apt repository

Florian Heinle
June 01, 2023Software engineer at makandra GmbH

When you're using a third party repository on your Ubuntu or Debian system and need to find out which packages are available in this repo and which versions, you can consult the local apt cache.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

In /var/lib/apt/lists you'll find a lot of *_Packages files that list the contents of apt repositories. Most repositories will have one file for the i386 architecture and one for the amd64 architecture. Make sure to pick the correct one.

To list the contents of the repository, view the respective files or, for a short summary:

/var/lib/apt/lists $ grep -E "(Package|Version)" ppa.launchpadcontent.net_git-core_ppa_ubuntu_dists_jammy_main_binary-amd64_Packages | paste - - | column -t
Package:  git                  Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-all              Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-cvs              Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-daemon-run       Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-daemon-sysvinit  Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-doc              Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-email            Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-gui              Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-man              Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-mediawiki        Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  git-svn              Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  gitk                 Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Package:  gitweb               Version:  1:2.41.0-0ppa1~ubuntu22.04.1
Posted by Florian Heinle to makandra Operations (2023-06-01 10:53)