How to check if an apt mirror has the version of package I required?

Solution 1:

You can run apt-get install -s openssl -t precise-security

  • The -s flag is just to simulate an install
  • The -t flag specifies the target release

This will return something like :

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  openssl
1 upgraded, 0 newly installed, 0 to remove and 64 not upgraded.
Inst openssl [1.0.1-4ubuntu5.11] (1.0.1-4ubuntu5.12 Ubuntu:12.04/precise-security [amd64])
Conf openssl (1.0.1-4ubuntu5.12 Ubuntu:12.04/precise-security [amd64])

Now, from here, you can see that version openssl 1.0.1-4ubuntu5.12 is available on this repository.

However, this will be reported only if the repository contains a newer version than the one installed on your system.


apt-cache policy openssl will report versions available for each repositories you have defined in your sources.list file (even if your system is already up to date - which is not my case) :

openssl:
  Installed: 1.0.1-4ubuntu5.11
  Candidate: 1.0.1-4ubuntu5.12
  Version table:
     1.0.1-4ubuntu5.12 0
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
 *** 1.0.1-4ubuntu5.11 0
        500 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.0.1-4ubuntu3 0
        500 http://fr.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages