Comment 12 for bug 1992026

Revision history for this message
Robie Basak (racb) wrote :

Running /usr/lib/update-notifier/apt-check will give you machine readable "how many updates are available" numbers for security and non-security updates. It's called by /usr/lib/update-notifier/update-motd-updates-available which is called from /etc/apt/apt.conf.d/99update-notifier in a APT::Update::Post-Invoke-Success hook, and then presented to the user through /etc/update-motd.d/90-updates-available. This may be an internal implementation detail of update-notifier. I'm not sure to what extent it's a public API, but in practice calling /usr/lib/update-notifier/apt-check for machine readable information has been consistently stable over many releases. If you want to use something that isn't officially stable but works in practice and this gives you the information you need, using this is probably the best option.

On -qq not being honoured by the hook, this is a good point, but I suggest that you file a separate bug for it - the fix would need to be a separate effort, so tracking it separately makes sense.