
Photo: libre-software.net. License: CC BY-SA 4.0
How to set up automatic updates on Ubuntu Server 20.04, 22.04 or 24.04
Last updated on May 27, 2024
This guide explains how to configure automatic updates in Ubuntu Server 20.04 “Focal Fossa”, Ubuntu Server 22.04 “Jammy Jellyfish” or Ubuntu Server 24.04 “Noble Numbat”.
Step 1: package installation
Install the unattended-upgrades
package:sudo apt install unattended-upgrades
This package may already be installed on your server.
Step 2: configure automatic updates
Edit the configuration file (here with nano – replace with any other text editor):sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
The beginning of the configuration file should look like this:
Anything after a double slash “//
” is a comment and has no effect. To “enable” a line, remove the double slash at the beginning of the line (replace with nothing or with spaces to keep alignment).
The most important: uncomment the “updates
” line by deleting the two slashes at the beginning of it:"${distro_id}:${distro_codename}-updates";
Recommended: remove unused kernel packages and dependencies and make sure the system automatically reboots if needed by uncommenting and adapting the following lines:
;Unattended-Upgrade::Remove-Unused-Kernel-Packages "true"
Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "02:38";
To save your changes in nano, use Ctrl + O followed by Enter. To quit, use Ctrl + X.
How to get email notification after automatic updates
Uncomment and adapt the following lines to ensure you’ll be notified if an error happens:
Unattended-Upgrade::Mail "user@example.com";
Unattended-Upgrade::MailReport "only-on-error";
Please note: your server needs to be able to send emails – which is mostly not the case by default! If you didn’t install and configure Postfix on your server, email notifications will NOT work.
Step 3: enable automatic updates
Enable automatic updates and set up update intervals by running:sudo nano /etc/apt/apt.conf.d/20auto-upgrades
In Ubuntu 22.04 and 24.04, the file has only the following two lines by default:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
Insert the following lines at the end of the file:
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
The time interval is specified in days, feel free to change the values. In total, you should have all four lines. Save changes and exit.
Step 4: check if it works
You can see if the auto-upgrades work by launching a dry run:sudo unattended-upgrades --dry-run --debug
The dry-run may output something like this:

Depending on your server configuration, the output may look less clean, which is OK:

Another way to check if automatic updates work is waiting a few days and checking the unattended upgrades logs:cat /var/log/unattended-upgrades/unattended-upgrades.log
Done! Ubuntu Server 20.04 / 22.04 / 24.04 should now update itself once a day.
By Johannes Eva, April 2018 – May 2024
10 thoughts on “AVIF browser test page: AVIF support in Chrome, Firefox, Edge…”
Ezgif even does animated AVIFs:
https://ezgif.com/avif-maker
AVIF is now supported in official Firefox 93:
https://www.mozilla.org/en-US/firefox/93.0/releasenotes/
Could you make a similar page for a JPEG XL test?
Thank you for your interest – a JPEG XL test page would be useful, but I have no time left at the moment. Hopefully at some time in 2022 🙂
The following plugin, coupled with the functions.php code mentioned in the post, will allow AVIF images to be uploaded via the Media Library.
https://wordpress.org/plugins/blob-mimes/
Sadly your site need javascript enable for the test avif vs jpeg. If noscript bloc everything, this page say that AVIF is not supported and display JPEG fallback.
In JS dependences there is also google-analytics that is not fair play for a libre-software website :(.
Thank you for your article anyway.
Actually, AVIF/JPEG fallback using the element is pure HTML and does not need Javascript, even on this site. And you’re right, I really should switch from GA to Matomo, it’s a matter of time. Cheers!
Nice article. Love how you included a detailed tutorial for WordPress. I have created a UX optimized converter that support bulk conversion, without the need of uploading files. You can find it on: https://avif.io/
The next update will include a settings panel on which you can edit the quality, effort and exif data.
Feel free to add it to the converter list if you feel like it’s a great addition. Sincerely, Justin
MConverter can convert most image formats to AVIF: https://mconverter.eu/convert/to/avif/
Another nice thing is that it supports batch converting of multiple files at the same time. For the compression it uses a CRF of 10, so the converted images look basically identical.
No option for android
I found this it really helped me and it support batch conversion please add it to the list:
https://play.google.com/store/apps/details?id=ebusky.avif.image.viewer.converter.pdf