MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
June
Sun Mon Tue Wed Thu Fri Sat
           
23
           
2024
Months
Jun
Dec


Sun, Jun 23, 2024 7:19 pm

Determining the version of an installed package on an Ubuntu Linux system

If you wish to view information for a package installed on an Ubuntu Linux system, you can use the command apt show packageName or dpkg -s packageName where packageName is the name of the relevant package. If you are only interested in the version number for a package, you can pipe the output of either command into the grep command.

$ apt show net-tools
Package: net-tools
Version: 1.60+git20181103.0eebece-1ubuntu5
Priority: optional
Section: net
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: net-tools Team <team+net-tools@tracker.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 819 kB
Depends: libc6 (>= 2.34), libselinux1 (>= 3.1~)
Homepage: http://sourceforge.net/projects/net-tools/
Task: ubuntukylin-desktop
Download-Size: 204 kB
APT-Manual-Installed: yes
APT-Sources: http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
Description: NET-3 networking toolkit
 This package includes the important tools for controlling the network
 subsystem of the Linux kernel.  This includes arp, ifconfig, netstat,
 rarp, nameif and route.  Additionally, this package contains utilities
 relating to particular network hardware types (plipconfig, slattach,
 mii-tool) and advanced aspects of IP configuration (iptunnel, ipmaddr).
 .
 In the upstream package 'hostname' and friends are included. Those are
 not installed by this package, since there is a special "hostname*.deb".

$ apt show net-tools | grep "Version:"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Version: 1.60+git20181103.0eebece-1ubuntu5
$ dpkg -s net-tools
Package: net-tools
Status: install ok installed
Priority: important
Section: net
Installed-Size: 800
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: foreign
Version: 1.60+git20181103.0eebece-1ubuntu5
Depends: libc6 (>= 2.34), libselinux1 (>= 3.1~)
Description: NET-3 networking toolkit
 This package includes the important tools for controlling the network
 subsystem of the Linux kernel.  This includes arp, ifconfig, netstat,
 rarp, nameif and route.  Additionally, this package contains utilities
 relating to particular network hardware types (plipconfig, slattach,
 mii-tool) and advanced aspects of IP configuration (iptunnel, ipmaddr).
 .
 In the upstream package 'hostname' and friends are included. Those are
 not installed by this package, since there is a special "hostname*.deb".
Homepage: http://sourceforge.net/projects/net-tools/
Original-Maintainer: net-tools Team <team+net-tools@tracker.debian.org>
$ dpkg -s net-tools | grep "Version:"
Version: 1.60+git20181103.0eebece-1ubuntu5
$

Another command that will show you the installed version of a package on a Ubuntu systems is apt-cache policy packageName.

$ apt-cache policy net-tools
net-tools:
  Installed: 1.60+git20181103.0eebece-1ubuntu5
  Candidate: 1.60+git20181103.0eebece-1ubuntu5
  Version table:
 *** 1.60+git20181103.0eebece-1ubuntu5 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
$

[/os/unix/linux/ubuntu] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo