I tried disabling the motd.dynamic in /var/run renaming the file, but did not work because the system recreates the file.
Does anyone know disable it?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
The script files in
/etc/update-motd.d generate the file
/var/run/motd.dynamic which you've identified as containing your MOTD.
A simplistic way to stop generating this file would be to make all of the scripts non-executable with:
chmod -x /etc/update-motd.d/*
Note: Information taken from this answer by heemayl.
If anyone landed here because they specifically wanted to disable the "news" (ie. ads/promotional blurbs for things like macOS Kubernetes tooling) portion of the dynamic MOTD, but don't mind the rest being there (eg. the pending updates notification), that's easy too.
example ad in motd:
* "If you've been waiting for the perfect Kubernetes dev solution for macOS, the wait is over. Learn how to install Microk8s on macOS." https://www.techrepublic.com/article/how-to-install-microk8s-on-macos/
Just open up
/etc/default/motd-news and set