“ 0个软件包可以更新”从何而来?


Answers:


22

这些消息来自update-motd

/etc/update-motd.d/updates-available脚本从生成此特定输出cat /var/lib/update-notifier/updates-available


0

要回答所有MOTD消息从何而来,请首先查看PAM配置。

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

看一下pam_motd.so运行的是什么。

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

'run-parts'在目录中依次运行所有脚本。

 % 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*

帮助程序脚本位于/ 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*

数据文件在/ var / lib / update-notifier中

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

要从命令行输出MOTD信息,可以

$ ssh localhost

要么

# run-parts /etc/update-motd.d
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.