Check the Pinned Priority
APT uses the repository with the highest priority. You can check the priority of each repository using the following command:
In this example, we will be looking for the docker-ce
package (or any Docker-related package) in the output. It will show the repository URL and its priority. For example:
Sample output:
The Candidate version indicates which repository is being used.
Inspect the installed package
If Docker is already installed, you can check the version and match it to the repository:
The output will show the installed version and the repository it came from.
Manually check the repository
If you want to ensure only one repository is used, you can comment out or remove the unwanted entry in /etc/apt/sources.list.d/download_docker_com_linux_ubuntu.list
. For example:
Comment out the line for focal if you want to use jammy:
Then update the package cache:
Verify the repository again
After making changes, verify the repository being used:
This will ensure that the correct repository (jammy in this case) is being used.
Written by
KarChunT
Last Updated
Sat May 10 2025
Tags