Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to customize the unattended-upgrades results mail in ubuntu?

The current configuration in /etc/apt/apt.conf.d/50unattended-upgrades file -

// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you 
// have a working mail setup on your system. The package 'mailx'
// must be installed or anything that provides /usr/bin/mail.
//Unattended-Upgrade::Mail "root@localhost";

sends an email on every run. Instead, I would like to customize it to send only on error. Is there any way I can configure that?

share|improve this question

Don't know why they deleted this line on Ubuntu, but Debian includes:

// Set this value to "true" to get emails only on errors. Default
// is to always send a mail if Unattended-Upgrade::Mail is set
//Unattended-Upgrade::MailOnlyOnError "true";

If your /etc/apt/apt.conf.d/50unattended-upgrades don't include the line (and the changelog don't give away this change in presice) is very odd, but at least it doesn't say they changed the behavior. I use a slightly updated version (0.80~sid2 opposed to 0.79.3ubuntu4 that Ubuntu includes in the precise-updates repository) and it will send a mail only on errors (I hasn't get a mail for now). Just write the lines to your configuration file, and everything should be working:

Unattended-Upgrade::Mail "";
Unattended-Upgrade::MailOnlyOnError "true";

You may want to run sudo unattended-upgrade -v -d --dry-run to check the entire process yourself.

share|improve this answer
Ubuntu (at least some versions) seem to ignore this line:… – dtech Jul 24 '14 at 8:30
In 14.04 LTS, the line Unattended-Upgrade::MailOnlyOnError "true"; is back in /etc/apt/apt.conf.d/50unattended-upgrades. It's commented out by default. – azimut Oct 15 '14 at 9:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.