[debian] How to check the version before installing a package using apt-get?

I'm thinking to install hylafax+ version 5.5.4 which was release last month on my Debian PC.

I checked dpkg -l | grep "hylafax" and found out that the current version is 5.5.3. Then I checked apt-cache search hylafax and saw the packages are available, but I can't see any version number.

How can I find the version of packages available in the apt-get?

This question is related to debian version apt apt-get dpkg

The answer is


As posted somewhere else, this works, too:

apt-cache madison <package_name>


Also, according to the man page:

apt-cache showpkg <package_name>

can also be used to:

...display information about the packages listed on the command line. Remaining arguments are package names. The available versions and reverse dependencies of each package listed are listed, as well as forward dependencies for each version. Forward (normal) dependencies are those packages upon which the package in question depends; reverse dependencies are those packages that depend upon the package in question. Thus, forward dependencies must be satisfied for a package, but reverse dependencies need not be.

Ex:

apt-cache policy conky

conky:
  Installed: (none)
  Candidate: 1.10.3-1
  Version table:
     1.10.3-1 500
        500 http://us.archive.ubuntu.com/ubuntu yakkety/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu yakkety/universe i386 Packages

The following might work well enough:

aptitude versions ^hylafax+

See more in aptitude(8)


on debian :

apt list --upgradable

gives the list with package, version to be upgraded, and actual version of the package.

result :

base-files/stable 8+deb8u8 amd64 [upgradable from: 8+deb8u7]
bind9-host/stable 1:9.9.5.dfsg-9+deb8u11 amd64 [upgradable from: 1:9.9.5.dfsg-9+deb8u9]
ca-certificates/stable 20141019+deb8u3 all [upgradable from: 20141019+deb8u2]
certbot/jessie-backports 0.10.2-1~bpo8+1 all [upgradable from: 0.8.1-2~bpo8+1]
dnsutils/stable 1:9.9.5.dfsg-9+deb8u11 amd64 [upgradable from: 1:9.9.5.dfsg-9+deb8u9]

Linux Mint, Debian 9, Ubuntu 16.04 and older:

Short info:

apt policy <package_name>

Detailed info (With Description and Depends):

apt show <package_name>

apt-cache policy <package-name>

$ apt-cache policy redis-server
redis-server:
  Installed: (none)
  Candidate: 2:2.8.4-2
  Version table:
     2:2.8.4-2 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

apt-get install -s <package-name>

$ apt-get install -s redis-server
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libjemalloc1 redis-tools
The following NEW packages will be installed:
  libjemalloc1 redis-server redis-tools
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Inst libjemalloc1 (3.5.1-2 Ubuntu:14.04/trusty [amd64])
Inst redis-tools (2:2.8.4-2 Ubuntu:14.04/trusty [amd64])
Inst redis-server (2:2.8.4-2 Ubuntu:14.04/trusty [amd64])
Conf libjemalloc1 (3.5.1-2 Ubuntu:14.04/trusty [amd64])
Conf redis-tools (2:2.8.4-2 Ubuntu:14.04/trusty [amd64])
Conf redis-server (2:2.8.4-2 Ubuntu:14.04/trusty [amd64])

apt-cache show <package-name>

$ apt-cache show redis-server
Package: redis-server
Priority: optional
Section: universe/misc
Installed-Size: 744
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Chris Lamb <[email protected]>
Architecture: amd64
Source: redis
Version: 2:2.8.4-2
Depends: libc6 (>= 2.14), libjemalloc1 (>= 2.1.1), redis-tools (= 2:2.8.4-2), adduser
Filename: pool/universe/r/redis/redis-server_2.8.4-2_amd64.deb
Size: 267446
MD5sum: 066f3ce93331b876b691df69d11b7e36
SHA1: f7ffbf228cc10aa6ff23ecc16f8c744928d7782e
SHA256: 2d273574f134dc0d8d10d41b5eab54114dfcf8b716bad4e6d04ad8452fe1627d
Description-en: Persistent key-value database with network interface
 Redis is a key-value database in a similar vein to memcache but the dataset
 is non-volatile. Redis additionally provides native support for atomically
 manipulating and querying data structures such as lists and sets.
 .
 The dataset is stored entirely in memory and periodically flushed to disk.
Description-md5: 9160ed1405585ab844f8750a9305d33f
Homepage: http://redis.io/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubunt

dpkg -l <package-name>

$ dpkg -l nginx
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                     Version                   Architecture              Description
+++-========================================-=========================-=========================-=====================================================================================
ii  nginx                                    1.6.2-1~trusty            amd64                     high performance web server

You can also just simply do the regular apt-get update and then, as per the manual, do:

apt-get -V upgrade

-V Show verbose version numbers

Which will show you the current package vs the one which will be upgraded in a format similar to the one bellow:

~# sudo apt-get -V upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
   curl (7.38.0-4+deb8u14 => 7.38.0-4+deb8u15)
   php5 (5.6.40+dfsg-0+deb8u2 => 5.6.40+dfsg-0+deb8u3)
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.0 MB of archives.
After this operation, 567 kB of additional disk space will be used.
Do you want to continue? [Y/n] 

apt policy <package>

for short


Also, the apt-show-versions package (installed separately) parses dpkg information about what is installed and tells you if packages are up to date.

Example..

$ sudo apt-show-versions --regex chrome
google-chrome-stable/stable upgradeable from 32.0.1700.102-1 to 35.0.1916.114-1
xserver-xorg-video-openchrome/quantal-security uptodate 1:0.3.1-0ubuntu1.12.10.1
$

Examples related to debian

E: Unable to locate package npm How to update-alternatives to Python 3 without breaking apt? What is difference between arm64 and armhf? github: server certificate verification failed "Call to undefined function mysql_connect()" after upgrade to php-7 Debian 8 (Live-CD) what is the standard login and password? How to set the locale inside a Debian/Ubuntu Docker container? ps command doesn't work in docker container Forwarding port 80 to 8080 using NGINX Switching users inside Docker image to a non-root user

Examples related to version

Which TensorFlow and CUDA version combinations are compatible? How can the default node version be set using NVM? Node - was compiled against a different Node.js version using NODE_MODULE_VERSION 51 Which ChromeDriver version is compatible with which Chrome Browser version? How to find which version of TensorFlow is installed in my system? How to update Ruby Version 2.0.0 to the latest version in Mac OSX Yosemite? What does 'Unsupported major.minor version 52.0' mean, and how do I fix it? Find nginx version? How to check all versions of python installed on osx and centos How can I specify the required Node.js version in package.json?

Examples related to apt

E: Unable to locate package npm How to update-alternatives to Python 3 without breaking apt? Package php5 have no installation candidate (Ubuntu 16.04) Amazon Linux: apt-get: command not found How do you run `apt-get` in a dockerfile behind a proxy? What is the difference/usage of homebrew, macports or other package installation tools? How to check the version before installing a package using apt-get? How to install "make" in ubuntu? Installing SciPy and NumPy using pip How can I get a list of repositories 'apt-get' is checking?

Examples related to apt-get

E: Unable to locate package npm Docker Repository Does Not Have a Release File on Running apt-get update on Ubuntu How to install Android SDK on Ubuntu? Ubuntu apt-get unable to fetch packages How to check the version before installing a package using apt-get? How to install Maven 3 on Ubuntu 18.04/17.04/16.10/16.04 LTS/15.10/15.04/14.10/14.04 LTS/13.10/13.04 by using apt-get? Installing Java 7 (Oracle) in Debian via apt-get Package opencv was not found in the pkg-config search path How to download all dependencies and packages to directory apt-get for Cygwin?

Examples related to dpkg

Package php5 have no installation candidate (Ubuntu 16.04) How to check the version before installing a package using apt-get?