29

After running apt-get upgrade, I get a list of the packages that will be upgraded. I would like to know the version number for one of these packages. (Not the current one but the one that will be installed).

How do I get the version number of the packages to be installed?

HopelessN00b
  • 1,891

2 Answers2

38
apt-cache show <packagename>

should include the full version numbers.


Update as this answer has recently seen upvotes:

With more recent releases you can use apt list <packagename> to get a display of the most pertinent information (version, installation status) in one line or apt show <packagename> for fuller information as provided by apt-cache. The other commands (and aptitude too if installed) still work as before.

Be sure to heed the warning emitted to stderr¹ if you pipe the output of apt to other commands, if you use it in a script or documentation that is intended to be around for a while.

[1] “apt does not have a stable CLI interface yet. Use with caution in scripts.”

18

If you just want the version info without the description and such, use apt-cache policy instead of apt-cache show.