Fixing Ubuntu MOTD and Landscape Related Login Delays

I recently switched OS'es on my home server from CentOS to Ubuntu. However, after the Ubuntu install I found that it was taking me several seconds to log into the server. There's a long delay that I attribute to the generation of the Ubuntu MOTD:


  System information as of Mon Jul  1 08:23:41 CDT 2013

  System load:  0.32               Processes:            124
  Usage of /:   20.0% of 12.83GB   Users logged in:      1
  Memory usage: 40%                IP address for eth0:  192.168.1.100
  Swap usage:   0%                 IP address for wlan0: 192.168.0.100

  => /mnt/backup0 is using 92.3% of 4.00GB

  Graph this data and manage this system at https://landscape.canonical.com/

If you're like me and you have no plans to use Canonical's Landscape utility, you can safely kill this delay and remove this big block of text from your MOTD with:

[bash] sudo apt-get remove landscape-client landscape-common [/bash]

You can take it a step further and delete all the config files with:

[bash] sudo apt-get purge landscape-client landscape-common [/bash]

However, I saw that even after removing the Landscape packages, my login was still slow and my MOTD was still bogged down.

There's a quick way of telling what else is impacting your Ubuntu MOTD, it doesn't even require root:

[bash] dpkg -S /etc/update-motd.d/* [/bash]

The output will look something like:


base-files: /etc/update-motd.d/00-header
base-files: /etc/update-motd.d/10-help-text
update-notifier-common: /etc/update-motd.d/90-updates-available
update-manager-core: /etc/update-motd.d/91-release-upgrade
update-notifier-common: /etc/update-motd.d/98-fsck-at-reboot
update-notifier-common: /etc/update-motd.d/98-reboot-required
base-files: /etc/update-motd.d/99-footer

Here, you can see that some of those Ubuntu MOTD lines are provided by the packages update-manager-core and update-notifier-common. The Update Manager (aka Software Updater in more recent Ubuntu releases) is pretty important in desktop Ubuntu, but probably less important in a LTS-based server. I opted to remove these and replace them with the unattended-upgrades package:

[bash] sudo apt-get remove update-notifier-common update-manager-core sudo apt-get install unattended-upgrades

this next command brings up an interactive prompt to

turn on/off the automatic security updates:

sudo dpkg-reconfigure -plow unattended-upgrades [/bash]

However, you might actually find the update manager useful, so remove it from your system (and your Ubuntu MOTD) at your own discretion.

Of course, depending on what packages you've got on your system, your Ubuntu MOTD might be more or less cluttered with other things than mine. You'll have to take a look at your packages and see if you're willing to remove or reconfigure some to reduce your login delays.