Ubuntu – How to find the list of all available packages along with the lastest version number available in the repositories

command linepackage-management

I want to list all the packages(installed or not installed) along with the latest version number available in the repositories.

For example:

The output of apt-cache policy chromium-browser shows like below

$ apt-cache policy chromium-browser
chromium-browser:
  Installed: (none)
  Candidate: 34.0.1847.116-0ubuntu2
  Version table:
     34.0.1847.116-0ubuntu2 0
        500 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty/universe amd64 Packages

So the latest version of chromium-browser package available in the repository is 34.0.1847.116-0ubuntu2. Like that, i want to list the version number along with the package names that are available in repositories. And all i want to do this through command-line.

I want the output to be like this,

chromium-browser 34.0.1847.116-0ubuntu2
xxxxxxxxxxxxxx   yyyyyyyyyyy
............     ............

Best Answer

apt-cache policy '.*' displays detailed version information for all packages.

If you want a more compact output with one line per package, you can use aptitude. The following command lists available versions (see the manual for output format specifications) for all packages except cross-architecture ones (e.g. 32-bit packages on a 64-bit system) (see the manual for search patterns):

aptitude search -F '%54p %24V' '~rnative'