How to find out the version of an installed program in Debian
The most obvious solution is to run the name of this command with one of the flags
- --version
- -v
- -V
For example
sed --version
sed (GNU sed) 4.7 Packaged by Debian Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Jay Fenlason, Tom Lord, Ken Pizzini, Paolo Bonzini, Jim Meyering, and Assaf Gordon. GNU sed home page: <https://www.gnu.org/software/sed/>. General help using GNU software: <https://www.gnu.org/gethelp/>. E-mail bug reports to: <bug-sed@gnu.org>.
In Debian , Ubuntu and other Debian derivatives you can run the command
dpkg -p package_name
For example, to find out the version of sed you need to run
dpkg -p sed
Package: sed Essential: yes Priority: required Section: utils Installed-Size: 336 Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Architecture: amd64 Multi-Arch: foreign Version: 4.7-1 Pre-Depends: libacl1 (>= 2.2.51-8), libc6 (>= 2.14), libselinux1 (>= 1.32) Filename: pool/main/s/sed/sed_4.7-1_amd64.deb Size: 189668 MD5sum: 2e2c9a0370c20a2a1921572f250db43e Description: GNU stream editor for filtering/transforming text Original-Maintainer: Clint Adams <clint@debian.org> SHA1: a8106de20fa00fc7f97a45d18ec411512cc64293 SHA256: a5428ddec609149eb6086cec20bf14a0300972a191eb0cc010e7f1c7f17186f4 Homepage: https://www.gnu.org/software/sed/ Task: minimal Description-md5: 2ed71305ee7a49ce4438c58140980d2f
The command dpkg -p, however, like the --version, -V flags, does not work with all programs
For example, if you run
dpkg -p virtualbox
you will most likely get the message
dpkg-query: package 'virtualbox' is not available
The command virtualbox --version will simply start Virtualbox
To find out the version of Virtualbox run
virtualbox --help
Oracle VM VirtualBox VM Selector v6.1.10_Ubuntu (C) 2005-2020 Oracle Corporation All rights reserved. No special options. If you are looking for --startvm and related options, you need to use VirtualBoxVM.
Article author: Andrei Olegovich