These messages are defined in /usr/lib/update-notifier/apt_check.py
with no flags to disable them.
Here's a sed command that will neuter the functions that generate the messages by inserting a return
statement as the first line of the message function:
sudo sed -Ezi.orig \
-e 's/(def _output_esm_service_status.outstream, have_esm_service, service_type.:\n)/\1 return\n/' \
-e 's/(def _output_esm_package_alert.*?\n.*?\n.:\n)/\1 return\n/' \
/usr/lib/update-notifier/apt_check.py
A diff of the old and new files looks like this:
$ diff -u /usr/lib/update-notifier/apt_check.py{.orig,}
--- /usr/lib/update-notifier/apt_check.py.orig 2023-02-22 11:33:39.476095290 -0500
+++ /usr/lib/update-notifier/apt_check.py 2023-02-22 11:59:41.396527682 -0500
@@ -160,6 +160,7 @@
def _output_esm_package_alert(
outstream, service_type, disabled_pkg_count, is_esm=False
):
+ return
" output the number of upgradable packages if esm service was enabled "
outstream.write("\n")
if disabled_pkg_count > 0:
@@ -206,6 +207,7 @@
def _output_esm_service_status(outstream, have_esm_service, service_type):
+ return
if have_esm_service:
outstream.write(gettext.dgettext("update-notifier",
"Expanded Security Maintenance for "
Test the fix with this command:
$ /usr/lib/update-notifier/apt_check.py --human-readable
1 update can be applied immediately.
To see these additional updates run: apt list --upgradable
Regenerate the cached message file
sudo /usr/lib/update-notifier/update-motd-updates-available --force
sudo chmod -x /etc/update-motd.d/90-updates-available
$HOME/.hushlogin
But this will disable all motd. Oh ssh maybe this is serverfault.com/questions/36421/… helpful.