understanding the output of “apt-cache policy”

I ran apt-cache policy sudo before and after installing sudo:

before install:

# apt-cache policy sudo
sudo:
  Installed: (none)
  Candidate: 1.8.5p2-1+nmu1
  Version table:
     1.8.5p2-1+nmu1 0
        500 http://ftp.se.debian.org/debian/ wheezy/main i386 Packages
#

after install:

# apt-cache policy sudo
sudo:
  Installed: 1.8.5p2-1+nmu1
  Candidate: 1.8.5p2-1+nmu1
  Version table:
 *** 1.8.5p2-1+nmu1 0
        500 http://ftp.se.debian.org/debian/ wheezy/main i386 Packages
        100 /var/lib/dpkg/status
#

How to understand numbers 500 and 100? Are those some sort of status codes? In addition, what is the meaning of *** in front of the package version once it is installed?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

500 and 100 are the priority numbers. To learn more about them, I recommend man apt_preferences. 500 corresponds to installable, 100 means installed.

From the man page:

If the target release has not been specified then APT simply assigns
priority 100 to all installed package versions and priority 500 to all
uninstalled package versions.

The *** just means installed, as far as I know. Once it has been installed, you see both 500 and 100, corresponding to the version in the archives and the locally installed version respectively.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x