apt – How do I reliably determine on Ubuntu when the latest version of a package was made available?

How to create a command, on Ubuntu, to report when the latest version of a given package was released?

(I need to check this as part of proving that we install certain updates on certain servers within a given time.)

Right now, my script does the following:

  • issue apt-cache policy <packagename>
  • extract the repository URLs for the latest version
  • issue apt-cache show <packagename>
  • extract the URL path for the latest version
  • concatenate them
  • issue a HTTP HEAD request for the resulting URLs
  • report the Last-Modified header value

This assumes the local index is up to date (i.e. sudo apt-get update or equivalent has been run recently enough). That is fine with me.

Apart from that assumption, how reliable is this? Is there a better way?