Where does 0 packages can be updated. come from in the login process?

2 Answers 2


These messages come from update-motd.

The /etc/update-motd.d/updates-available script generates this specific output from cat /var/lib/update-notifier/updates-available


In answer to where do all of the MOTD messages come from, first look at the PAM configs.

 % grep -C1 motd /etc/pam.d/*
 /etc/pam.d/sshd:session optional pam_motd.so motd=/run/motd.dynamic

Look to see what pam_motd.so runs.

 % strings /lib/x86_64-linux-gnu/security/pam_motd.so
 run-parts /etc/update-motd.d > /run/motd.dynamic.new

'run-parts' runs all the scripts, in order, in a directory.

 % ls /etc/update-motd.d/
 00-header*     80-esm*  91-release-upgrade*  98-reboot-required*
 10-help-text*  80-livepatch*          95-hwe-eol*
 50-motd-news*  90-updates-available*  98-fsck-at-reboot*

Helper scripts are in /usr/lib/update-notifier/update-motd*


Data files are in /var/lib/update-notifier

 dpkg-run-stamp  hwe-eol                  updates-available
 fsck-at-reboot  package-data-downloads/  user.d/

To output the MOTD info from the command line, either

$ ssh localhost


# run-parts /etc/update-motd.d

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .