Ubuntu – How to disable release upgrade notification emails

emailnotificationupgrade

I have an Ubuntu 14.04 server installation that consistently sends a weekly email, from the root user, with the following content:

/etc/cron.weekly/update-notifier-common:
New release '16.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

How do I stop these emails, without upgrading to 16.04? Is there a method that doesn't involve disabling the script mentioned in the first line of the email?

Ideally I'd like to allow /etc/cron.weekly/update-notifier-common to continue to run, calling the /usr/lib/ubuntu-release-upgrader/release-upgrade-motd and /usr/lib/ubuntu-release-upgrader/check-new-release scripts, but stop new release messages. It would be useful for these scripts to still warn if my current release becomes EOL.

Best Answer

By default cron sends mail to the email address mentioned in the MAILTO environment variable on crontab, presumably you have set the email address, so any STDOUT/STDERR from any cron job will be sent to the email address.

The output is from /usr/lib/ubuntu-release-upgrader/release-upgrade-motd script (run by the weekly job /etc/cron.weekly/update-notifier-common) that checks for a new version, and dump the content of /var/lib/ubuntu-release-upgrader/release-upgrade-available file.

You have a few options:

  • Disable the job

  • Redirect STDOUT/STDERR from the script to /dev/null

  • Set MAILTO="" so that no mail will be sent. As /usr/sbin/anacron exists the script will be run by anacron, so setting this in /etc/anacrontab would do too.