This script suppresses the Ubuntu Pro/Expanded Security Maintenance promotional notices printed during login. It does not disable Ubuntu Pro services, uninstall packages, change APT sources, or hide ordinary package and security update counts.
It uses Ubuntu's marker file:
/var/lib/update-notifier/hide-esm-in-motd
After changing the marker, it forces update-notifier to rebuild its cached
update text and regenerates /run/motd.dynamic. This avoids leaving an older
Pro/ESM message visible until the cache refreshes naturally.
GIST_RAW="https://gist.githubusercontent.com/lbussy/d41d1ebc9a6e4930be955ea1e66bf784/raw/ubuntu-esm-motd.sh"
curl -fsSL "$GIST_RAW" -o /tmp/ubuntu-esm-motd.sh
less /tmp/ubuntu-esm-motd.sh
sh /tmp/ubuntu-esm-motd.sh status
sudo sh /tmp/ubuntu-esm-motd.sh disable
rm /tmp/ubuntu-esm-motd.shRunning the script without an argument is the same as status and makes no
changes. Only disable and enable require root privileges.
Review-first use is safer because a mutable remote script can change. If you trust this Gist and deliberately accept that risk:
curl -fsSL "https://gist.githubusercontent.com/lbussy/d41d1ebc9a6e4930be955ea1e66bf784/raw/ubuntu-esm-motd.sh" | sudo sh -s -- disableInspect without making changes:
curl -fsSL "https://gist.githubusercontent.com/lbussy/d41d1ebc9a6e4930be955ea1e66bf784/raw/ubuntu-esm-motd.sh" | sh -s -- statusRestore the Pro/ESM login notices:
curl -fsSL "https://gist.githubusercontent.com/lbussy/d41d1ebc9a6e4930be955ea1e66bf784/raw/ubuntu-esm-motd.sh" | sudo sh -s -- enablegrep -Ei 'Expanded Security Maintenance|ESM Apps|ubuntu\.com/esm|pro status' \
/run/motd.dynamic || echo 'No Pro/ESM notices found'The next interactive SSH login should retain normal update counts but omit the Ubuntu Pro/ESM promotional paragraphs.
- Ubuntu systems using
update-notifierand/etc/update-motd.d - POSIX
/bin/sh; no Bash-specific features required - Idempotent: repeated
disableorenablecalls are safe