disable everything in update-motd.d dir in ubuntu server

mitjab@server:/etc/update-motd.d$ dir
00-header  10-help-text  91-release-upgrade  98-fsck-at-reboot  99-footer
mitjab@server:/etc/update-motd.d$

i need to remove all auto updates or notifiers in my ubuntu server becouse it is to slow. How can i remove or disable it. Now when i login to server it takes 30s to see server when i write username and passwd.

How can i disable all this..

if i run

mitjab@server:/etc/update-motd.d$ update-motd --disable
/usr/bin/python: can't find '__main__' module in '/usr/share/command-not-found'

Solution 1:

In the files /etc/pam.d/login and /etc/pam.d/sshd cut out the string «session optional pam_motd.so»

Solution 2:

You can remove execute permission:

chmod -x /etc/update-motd.d/*

Solution 3:

use dpkg to list what has put things in your motd:

dpkg -S /etc/update-motd.d/

uninstall it with apt-get:

(for example)
sudo apt-get remove --purge update-manager-core
sudo apt-get remove --purge landscape-common
sudo apt-get remove --purge update-notifier-common

Solution 4:

  • There may be the update-motd package was installed with OS installation. You can remove whole package with this command: apt-get remove --purge update-motd in debian and derivatives. You must find out how to remove it from your OS if you don't using a debian derivative.

  • If you think you did not install anything for motd or you culd not remove that you can check for session optional pam_motd.so line in /etc/pam.d/sshd and /etc/pam.d/login. Remove line from those files if exist in any.

  • Or if you don't want remove anything, you can change files mode to 600 in /etc/update-motd.d/* folder. Folder path might be differs according to your distro.