Ubuntu 18.04 – How to Remove MOTD

motdubuntu-18.04

Anyone know exactly which package(s) to remove to git rid of all the login cruft on Ubuntu 18.04?

Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-52-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * MicroK8s 1.15 is out! It has already been installed on more
   than 14 different distros. Guess which ones?

     https://snapcraft.io/microk8s

I thought it might be the update-motd package but after issuing apt purge update-motd there are still files/directories left in /etc/. dpkg -S reports these files belong to the base-files package which I probably don't want to purge.

# find /etc/ | grep motd
/etc/motd
/etc/systemd/system/timers.target.wants/motd-news.timer
/etc/update-motd.d
/etc/update-motd.d/10-help-text
/etc/update-motd.d/97-overlayroot
/etc/update-motd.d/50-motd-news
/etc/update-motd.d/00-header
/etc/default/motd-news

# dpkg -S /etc/update-motd.d/10-help-text 
base-files: /etc/update-motd.d/10-help-text

I've gotten around this in the past with just brute-force file removal but wondering if there's a better way to do it. Preferably something I could also easily work into an ansible playbook.

Best Answer

The motd comes from here. To remove it, open /etc/default/motd-news and set ENABLED=0.

See this thread from Hacker News.

Related Topic