Debian/Ubuntu: Show available updates (or control if all updates are installed)

Hi everyone,

is it possible to show all available updates on Debian/Ubuntu/...
via apt? Or rather, check if all updates have been installed without
errors?

Basically something like this (which does not work, I have not
tested why):

---

- name: refresh cache
apt: update_cache=yes

- name: Show all available updates become: true shell: apt-get
upgrade -u | mail -s "Available Updates on $(hostname -f)" root

Thanks in advance!

Johannes

For one thing, once my apt module pull request #2944 gets merged you can use « --check --diff » to see the list of packages to be upgraded.

Nice to know, thanks!

Johannes