31

How can I list all available versions of specific package?

I know with

apt-get install myPackage=1.2.3 

a specific version could be installed. And with

apt-show-versions -a myPackage 

I would get a list of versions that are known by the system.

But how getting a list of all available versions. I think that isn't possible using the apt tools because they are restricted to configured repositories.

So what is the way to go? Some web-repositories? What is the recommondation for Ubuntu 8.04?

user33401
  • 313
  • 1
  • 3
  • 5

4 Answers4

25

Try with

apt-cache madison myPackage

Quote from man page:

It displays available versions of a package in a tabular format.

sntg
  • 1,424
  • 11
  • 15
  • 3
    [The madison tool no longer exists](https://www.quora.com/Why-is-there-an-apt-cache-command-madison). Now we have `apt-cache showpkg` and `apt-cache policy`. – Pablo A May 29 '18 at 06:08
  • This seems to only show locally available versions of the package. If you want all versions (including remote), this might do it: https://askubuntu.com/a/449/48214 – Ryan Mar 05 '20 at 17:47
9

If you like to know which package versions are included into some particular Debian/Ubuntu/Backports release, rmadison tool from devscripts package could be the answer. For example:

$ rmadison -u debian,ubuntu,bpo mercurial | cut -d "|" -f 1-3
debian:
 mercurial | 0.9.1-1+etch1 |     etch-m68k 
 mercurial | 0.9.1-1+etch1 |     oldstable 
 mercurial |  1.0.1-5.1 |        stable 
 mercurial |    1.5.1-2 |       testing 
 mercurial |    1.5.2-1 |      unstable 
ubuntu:
 mercurial |      0.7-8 | dapper/universe 
 mercurial |    0.9.5-3 | hardy/universe 
 mercurial | 1.0.1-5.1~hardy1 | hardy-backports/universe 
 mercurial | 1.1.2-2ubuntu1 | jaunty/universe 
 mercurial |    1.3.1-1 | karmic/universe 
 mercurial |    1.4.3-1 | lucid/universe 
 mercurial |    1.5.2-1 | maverick/universe 
bpo:
 mercurial | 1.0.1-5.1~bpo40+1 | etch-backports 
 mercurial | 1.3.1-1~bpo50+2 | lenny-backports 

It will show "official" information, regardless of repositories you have configured on your system.

Please note, that versions between releases are not kept as a part of official repositories. However, you can give a shot to recently launched http://snapshot.debian.org service, which allows to access to old packages based on dates and version numbers uploaded to Debian archive since around 2005.

Similar tool you may be interested in is whohas, which goes far beyond Debian family. It's able to show versions of available software for other distributions (Arch, openSUSE, Gentoo, FreeBSD and even more - 14 distros at the moment).

Hope that helps.

PrecariousJimi
  • 1,512
  • 9
  • 16
8
apt-cache policy myPackage
Peter Eisentraut
  • 3,575
  • 1
  • 23
  • 21
3

As @Ilya pointed out you can use whohas:

whohas -d Debian,Ubuntu package | tr -s ' ' '\t' | cut -f 1-3 | column -t