Debian – Show apt-get package version

On Debian, you can use apt-cache policy 'package name' to check the package version.

1.1 Display Tomcat7 version.


$ sudo apt-cache policy tomcat7
tomcat7:
  Installed: (none)
  Candidate: 7.0.52-1ubuntu0.3
  Version table:
     7.0.52-1ubuntu0.3 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     7.0.52-1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

1.2 Display OpenJDK-7 version.


$ sudo apt-cache policy openjdk-7-jdk
openjdk-7-jdk:
  Installed: (none)
  Candidate: 7u95-2.6.4-0ubuntu0.14.04.1
  Version table:
     7u95-2.6.4-0ubuntu0.14.04.1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     7u51-2.4.6-1ubuntu4 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

1.3 Alternatively, try apt-cache madison 'package name'


$ sudo apt-cache madison tomcat7

   tomcat7 | 7.0.52-1ubuntu0.3 | http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
   tomcat7 | 7.0.52-1ubuntu0.3 | http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
   tomcat7 |   7.0.52-1 | http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

References

  1. apt-cache – Linux man page
  2. apt-get – Linux man page

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar