Posted on
Operating Systems

Automated System Updates: Ubuntu’s `unattended-upgrades` vs. DNF Plugins

Author
  • User
    Linux Bash
    Posts by this author
    Posts by this author

Automated System Updates: Ubuntu’s unattended-upgrades vs. DNF Plugins

Keeping your Linux system up-to-date is crucial for security, performance, and stability. While both newbies and seasoned users understand the importance of updates, managing them manually can be a time-consuming task. This is where automated update tools come in handy. In this blog, we'll explore how automated system updates work in Ubuntu using unattended-upgrades and in Fedora (or RHEL-based systems) using DNF Automatic, comparing their functionalities and ease of use.

What are Automated System Updates?

Automated system updates allow your Linux operating system to check for, download, and install updates without user intervention. This process ensures that your system is always secure and efficient, receiving all crucial patches and enhancements as soon as they are available.

Ubuntu’s unattended-upgrades

Ubuntu, which is based on Debian, utilizes a package called unattended-upgrades to automate the updating of packages that meet certain criteria. This tool is specifically designed to handle security updates, though it can be configured to apply all available updates automatically.

Setting up unattended-upgrades:
  1. Installation: If not already installed, you can install it using the command:

    sudo apt-get install unattended-upgrades
    
  2. Configuration: The configuration file for unattended-upgrades is located at /etc/apt/apt.conf.d/50unattended-upgrades. You can edit this file to choose which updates to apply automatically.

  3. Enabling: Enable the service with:

    sudo dpkg-reconfigure -plow unattended-upgrades
    

    This will set up unattended-upgrades to run regularly.

unattended-upgrades is highly customizable, allowing users to specify, for instance, not to update packages that need a system restart or to handle updates in specific ways if they are holding back other packages.

DNF Automatic in Fedora

DNF, which stands for Dandified Yum, is the next-generation version of the YUM package manager used in Fedora, CentOS, and RHEL. DNF Automatic is a plugin for DNF that automatically performs package updates.

Setting up DNF Automatic:
  1. Installation: To begin using it, install the DNF Automatic package using:

    sudo dnf install dnf-automatic
    
  2. Configuration: The configuration file lies at /etc/dnf/automatic.conf. Here, you can configure how often updates should be checked, whether they should be downloaded and/or installed, and the type of updates to apply (security, default, minimal).

  3. Activating: Enable the DNF Automatic timer with:

    sudo systemctl enable --now dnf-automatic.timer
    

    This will check for updates at the scheduled times defined in your configuration.

DNF Automatic also provides options for automatically handling updates that require a reboot and sending email notifications post updates, making it a robust tool for systems administration.

Comparison and Conclusion

Both unattended-upgrades and DNF Automatic offer robust solutions for automating system updates in their respective environments. Here's how they stack up:

  • Configuration: Both tools have fairly straightforward configurations, though unattended-upgrades is slightly simpler just to get up and running with default settings for security updates.

  • Flexibility: DNF Automatic is slightly more flexible out of the box with options for automatic reboots and detailed email notifications.

  • Security: Both tools are secure, with unattended-upgrades having a slight edge in environments where security updates are paramount.

In conclusion, choosing between unattended-upgrades and DNF Automatic largely comes down to whether you are using a Debian-based or Fedora/RHEL-based system. Both are excellent tools that provide the automation necessary to keep your systems up-to-date and secure with minimal fuss. Whether you prefer Ubuntu’s simplicity with unattended-upgrades or the added flexibility of DNF Automatic in Fedora could very well hinge on your specific administrative and security needs.