Konstantin Tutsch

Home

How to configure automatic updates on Fedora with e-mail reports


Requirements

You first need to install dnf-automatic, postfix and mailx:

dnf install -y dnf-automatic postfix mailx

After all programms have been installed, you can start configuring the e-mail server.

E-Mail Server


Notice as of May 7th, 2024: Alternatively, send DNF Automatic's email reports via an already existing server.


Postfix's configuration is located at /etc/postfix/main.cf. These are the values that should be set:

I have configured Postfix like this:

myhostname = notmalware.info
mydomain = notmalware.info

mynetworks_style = host

To test your Postfix configuration, you can execute this command:

echo "Hi, I'm your e-mail's body!" | mailx -r "test@server" -s "A test e-mail from Postfix!" "you@example.com"

Now that your e-mail server is working fine, you can configure DNF Automatic! 🤩

DNF Automatic

Automatic is a component of DNF. It's configuration file is located at /etc/dnf/automatic.conf.

Here are all the necessary configuration parameters:

[commands]

[emitters]

[command_email]

This is my configuration:

[commands]
# Check for updates daily
random_sleep = 86400

download_updates = yes
apply_updates = yes
reboot = when-needed

[emitters]
emit_via = command_email

[command_email]
command_format = "mailx -s {subject} -r {email_from} {email_to}"

email_from = dnf@notmalware.info
email_to = me@example.com

Finally, you need to enable one of DNF Automatic's systemd timers.

SystemD

If you have set e. g. download_updates to yes in your configuration, the timers settings will be overritten by the parameter(s).

You can choose between these three timers:

I chose the installer timer:

systemctl enable --now dnf-automatic-install.timer

Done

Next time there are updates due, you will receive an e-mail telling you to not worry about it! 🥳

If you want to have a closer look at DNF Automatic, check out it's documentation.


Subscribe via RSS

Tags: Self-hosting

© Konstantin Tutsch: CC BY-SA 4.0Disclaimer, Privacy