There are various commands or options that can tell you about the version number on Debian or Ubuntu Linux based system. Let us see commands to check package version using apt-get command or apt command or aptitude command on a Debian or Ubuntu Linux server.
Method #1: Ubuntu Linux package version apt-cache command
The syntax is:
apt-cache policy {package}
OR
apt-cache madison {package}
For example, before I install nginx package I would like to know what version of nginx I would get on my system, run:
$ apt-cache policy nginx
OR
$ apt-cache madison nginx
Fig.01: apt-cache check package version on Debian/Ubuntu Linux
Method #2: Debian Linux package version using apt command
The syntax is
apt list {package-name-here}
apt list vim
Sample outputs:
Listing... Done
vim/xenial,now 2:7.4.963-1ubuntu5 amd64 [installed]
I have vim package # 7.4.963 version installed on my system.
Method #3: Check package version using aptitude command
The syntax is:
aptitude versions {package-name-here}
aptitude versions {package-name-here} | more
aptitude versions {package-name-here} | awk { print $2 }
To find htop version you are about to install on Ubuntu server, enter:
$ aptitude versions htop
Sample outputs:
Package htop: p 1.0.3-1build1 xenial 500 Package htop:i386: p 1.0.3-1build1 xenial 500
Method #4: Package simulation using aptitude or apt-get command
The syntax is as follows:
aptitude -V -s install {package-name-here}
apt-get -V -s install {package-name-here}
No action taken. It perform a simulation of events that would occur based on the current system state but do not actually change the system. Of course, press n when prompted to avoid installation.
A note about finding version of installed packages
Use the following syntax:
apt-show-versions {package-name-here}
OR
dpkg -s {package-name-here}
dpkg -s {package-name-here} | grep -i version
To see version of install package called vim, run:
$ apt-show-versions vim
vim:amd64/xenial 2:7.4.963-1ubuntu5 uptodate
vim:i386 not installed
OR
$ dpkg -s vim | grep -i version
Version: 2:7.4.963-1ubuntu5
Vim is an almost compatible version of the UNIX editor Vi.
This package contains a version of vim compiled with a rather
version of Vim. See the other vim-* packages if you need more
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 1 comment... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
i will all linux and gnu begin to windows upp data all have windows 10 can update to debian vs utbuntu vs suse texplar