Joe Inwap Asked: 2019-06-03 15:56:15 +0800 CST2019-06-03 15:56:15 +0800 CST 2019-06-03 15:56:15 +0800 CST Where does "0 packages can be updated." come from? 772 Where does 0 packages can be updated. come from in the login process? command-line login 2 Answers Voted SHawarden 2019-06-03T16:13:08+08:002019-06-03T16:13:08+08:00 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 Joe Inwap 2019-06-15T21:36:49+08:002019-06-15T21:36:49+08:00 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* /usr/lib/update-notifier/update-motd-fsck-at-reboot* /usr/lib/update-notifier/update-motd-hwe-eol* /usr/lib/update-notifier/update-motd-reboot-required* /usr/lib/update-notifier/update-motd-updates-available* 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 or # run-parts /etc/update-motd.d
These messages come from
update-motd
.The
/etc/update-motd.d/updates-available
script generates this specific output fromcat /var/lib/update-notifier/updates-available
In answer to where do all of the MOTD messages come from, first look at the PAM configs.
Look to see what pam_motd.so runs.
'run-parts' runs all the scripts, in order, in a directory.
Helper scripts are in /usr/lib/update-notifier/update-motd*
Data files are in /var/lib/update-notifier
To output the MOTD info from the command line, either
or