I’ve got four servers right now, and was wondering if someone had written a program to email the system adminstrator if there are any updates needed. Yep: apticron

Obviously, you need to be using Debian, or a derivative.

$ sudo -s
# apt install apticron
# cp /usr/lib/apticron/apticron.conf /etc/apticron
# vim /etc/apticron/apticron.conf

And then add your email as below, found near the top of the file:

EMAIL=“you@yourdomain.com”

From now on, you’ll get an email whenever apticron finds updates that you haven’t yet installed. Below is the email that I got for one of my machines (my details hidden):

Subject: 2 Debian package update(s) for yourdomain.com

body:

apticron report [Fri, 30 Apr 2021 17:42:05 +0100]
====================================================================

apticron has detected that some packages need upgrading on:

yourdomain.com [ your server ip address ]

The following packages are currently pending an upgrade:

linux-image-4.19.0-16-cloud-amd64 4.19.181-1 linux-image-cloud-amd64 4.19+105+deb10u11

====================================================================

Package Details:

apt-listchanges: Reading changelogs…
apt-listchanges: Changelogs
—————————————-

—- Changes for linux-latest (linux-image-cloud-amd64) —-
linux-latest (105+deb10u11) buster; urgency=medium

* Update to 4.19.0-16 — Salvatore Bonaccorso Fri, 19 Mar 2021 22:38:58 +0100

linux-latest (105+deb10u10) buster; urgency=medium

* Update to 4.19.0-15 — Salvatore Bonaccorso Sat, 06 Mar 2021 08:37:46 +0100

linux-latest (105+deb10u9) buster-security; urgency=high

* Update to 4.19.0-14 — Salvatore Bonaccorso Sat, 30 Jan 2021 08:43:43 +0100

linux-latest (105+deb10u8) buster; urgency=medium

* Update to 4.19.0-13 — Salvatore Bonaccorso Fri, 27 Nov 2020 19:01:04 +0100

linux-latest (105+deb10u7) buster-security; urgency=high

* Update to 4.19.0-12 — Salvatore Bonaccorso Sun, 18 Oct 2020 14:43:57 +0200

linux-latest (105+deb10u6) buster; urgency=medium

* Update to 4.19.0-11 — Salvatore Bonaccorso Fri, 18 Sep 2020 20:48:30 +0200

linux-latest (105+deb10u5) buster; urgency=medium

* Update to 4.19.0-10 — Salvatore Bonaccorso Thu, 09 Jul 2020 21:58:28 +0200

linux-latest (105+deb10u4) buster; urgency=medium

* Update to 4.19.0-9 — Salvatore Bonaccorso Wed, 29 Apr 2020 16:16:38 +0200

linux-latest (105+deb10u3) buster; urgency=medium

* Update to 4.19.0-8 — Salvatore Bonaccorso Fri, 31 Jan 2020 06:24:52 +0100

linux-latest (105+deb10u2) buster; urgency=medium

* Update to 4.19.0-7 — Salvatore Bonaccorso Sun, 29 Dec 2019 22:39:49 +0100

linux-latest (105+deb10u1) buster; urgency=medium

* Update to 4.19.0-6 — Ben Hutchings Mon, 26 Aug 2019 02:16:02 +0100

====================================================================

You can perform the upgrade by issuing the command:

apt-get dist-upgrade

as root on yourdomain.com


apticron

How awesome is that!