I'm using Raspbian Jessie Lite. I've configured unattended upgrades as detailed here, but I don't seem to be getting any emails.

Updates were installed this morning:

2016-04-03 06:52:55,942 INFO Initial blacklisted packages: 
2016-04-03 06:52:55,945 INFO Starting unattended upgrades script
2016-04-03 06:52:55,945 INFO Allowed origins are: ['o=Raspbian,n=jessie']
2016-04-03 06:54:47,863 INFO Packages that will be upgraded: apt apt-utils gnupg gpgv initramfs-tools libapt-inst1.5 libapt-pkg4.12 libc-bin libc-dev-bin libc6 libc6-dbg libc6-dev libcairo-gobject2 libcairo2 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgudev-1.0-0 libhogweed2 libnettle4 libpcre3 libsystemd0 libudev1 locales multiarch-support systemd systemd-sysv tzdata udev
2016-04-03 06:54:47,874 INFO Writing dpkg log to '/var/log/unattended-upgrades/unattended-upgrades-dpkg_2016-04-03_06:54:47.868197.log'
2016-04-03 06:58:01,365 INFO All upgrades installed

I have the required packages installed:

unattended-upgrades/stable,now 0.81+rpi1 all [installed]
apt-listchanges/stable,now 2.85.13+nmu1 all [installed]
bsd-mailx/stable,now 8.1.2-0.20141216cvs-2 armhf [installed]

mailx works fine for sending email (I've set up postfix and all local mail gets passed on to a real mail account; there's nothing in the mail logs from this morning, except the test email I just sent).

Mail is turned on:

# /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Mail "root";

Not sure how to debug further :(


Don't I feel a fool...

danny@raspberrypi:~ $ cat /etc/apt/apt.conf.d/50unattended-upgrades | grep Mail
Unattended-Upgrade::Mail "root";
// is to always send a mail if Unattended-Upgrade::Mail is set
Unattended-Upgrade::MailOnlyOnError "true";

Email only on errors... that's not the default! I wondered how this happened; then checked what I had in my Pi setup script...

sudo sed -i 's/^\/\/Unattended-Upgrade::Mail/Unattended-Upgrade::Mail/g' /etc/apt/apt.conf.d/50unattended-upgrades

This line was designed to uncomment the line to send mail, not the only to only send mail on errors. Whoops!

  • root is also normally a local mail account. often postfix can be overkill for a small server/VM, and it is yet another daemon running, have a look at ssmtp wiki.archlinux.org/index.php/SSMTP. Depending on what the servers/VM do, often unattended upgrades might not be the best of the ideas. In the past I traced a source of instability to my "rapsberry" like device to unattended upgrades, though I think the problem is already solved. I also normally have a script/routine that does all the upgrades I need via Ansible, and I only invoke it when I am around to peruse the report. – Rui F Ribeiro Apr 3 '16 at 8:56
  • I spent several days trying various MTAs, inc ssmtp and postfix was the first one I was able to make do what I needed (details here. Overkill it may be, but it was only a few lines once I cracked it, and it's working :) – Danny Tuppeny Apr 3 '16 at 10:45
  • 2
    This is just a Pi running a few things for me and the kids. I figured it was best to let it keep itself up-to-date than not. If stuff breaks, there's no big deal; but I think that's a smaller risk than an internet-exposed device being unpatched :) – Danny Tuppeny Apr 3 '16 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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