Check Which Repository Provides Package using APT

Check Which Repository Provides Package using APT

Package repositories define where software packages are downloaded from and which versions are available for installation. In Debian-based systems (Ubuntu, Linux Mint, Kali, etc.), APT offers tools for inspecting repository information associated with a package. This can help determine whether a package is provided by the official distribution repositories or by an external source such as a PPA. This tutorial demonstrates how to check which repository provides package using APT.

The apt-cache or apt command with policy argument displays package version details together with repository origins and priority values. It is useful for identifying available package sources and determining which version would be selected for installation.

For example, the following command shows repository information for the git package:

apt-cache policy git
apt policy git

Example output:

git:
  Installed: (none)
  Candidate: 1:2.54.0-0ppa1~ubuntu26.04.1
  Version table:
     1:2.54.0-0ppa1~ubuntu26.04.1 500
        500 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu resolute/main amd64 Packages
     1:2.53.0-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu resolute/main amd64 Packages

In this example, the package is available from two different repositories. The candidate version originates from the Git Core PPA, while another version is provided by the official Ubuntu archive. Since both repositories have the same priority value, APT selects the newer package version as the installation candidate.

Leave a Comment

Cancel reply

Your email address will not be published.