Keeping your Fedora Linux system current is vital for security, performance, and peace of mind. If manual updates feel like a chore, or if you’re concerned about missing crucial patches, learning how to install DNF Automatic on Fedora is your solution. This guide will walk you through setting up this powerful tool to automate your system updates—covering installation, configuration, scheduling, and troubleshooting—so you can maintain a secure and efficient Fedora system with minimal effort.
What is DNF Automatic on Fedora?
DNF Automatic is a lightweight, command-line tool that automates checking for, downloading, and applying updates to your Fedora Linux system. It extends the DNF package manager’s functionality, letting you schedule updates for security patches, bug fixes, and new features. As a result, you can maintain a secure and up-to-date system with less effort.
Key features include:
- Notification Options: Configure how you receive update notifications, including email or system messages. This ensures you stay informed about important updates.
- Automated Updates: Choose to download updates only, apply updates automatically, or receive notifications about available updates. Therefore, you can tailor the update process to your preferences.
- Customizable Schedule: Use systemd timers to set specific intervals for update checks. In addition, you can align update checks with your maintenance windows.
Why Install DNF Automatic on Fedora?
Keeping your system updated is critical for maintaining security and performance. Therefore, DNF Automatic is an essential tool for Fedora users. Here’s why:
- Saves Time: Automates routine tasks, so you can focus on more important work. As a result, you increase your productivity.
- Enhances Security: Quickly applies critical patches to protect your system from vulnerabilities. Furthermore, you reduce the risk of security breaches.
- Reduces Downtime: Lets you schedule updates during non-critical hours to minimize disruption. Consequently, your workflow remains uninterrupted.
- Customizable Behavior: Allows you to configure it for simple notifications or fully automated updates. In other words, you have full control over how updates are managed.
How to Install DNF Automatic on Fedora Linux
Prerequisites for Installing DNF Automatic on Fedora
Before you begin the steps to install DNF Automatic on Fedora, it’s important to ensure you meet the following prerequisites:
- Have root or sudo privileges on your Fedora Linux system. Otherwise, you will not be able to install or configure system packages.
- Connect your system to the internet to download packages. Without an internet connection, installation cannot proceed.
Step 1: Installing DNF Automatic on Fedora
To install DNF Automatic on Fedora, open your terminal and run the following command. This is the first step in automating your system updates:
sudo dnf install dnf-automatic
This command installs the DNF Automatic package along with any required dependencies. Afterward, you are ready to verify the installation.
Step 2: Verifying Your DNF Automatic Installation
After installation, verify the package by running the following command. This ensures that DNF Automatic is installed correctly:
rpm -q dnf-automatic
If the package is installed, the command returns the installed version of DNF Automatic. Otherwise, you may need to repeat the installation step.
Configuring DNF Automatic on Fedora
DNF Automatic’s configuration file, located at /etc/dnf/automatic.conf
, defines its behavior. Edit this file to customize how your system handles updates. In addition, you can fine-tune the update process to match your needs.
Step 3: Editing the DNF Automatic Configuration File
Open the configuration file in your preferred text editor. For example, you can use nano or vim:
sudo nano /etc/dnf/automatic.conf
The configuration file contains several sections. Key settings you can configure include the following:
- apply_updates: Set this to
yes
to enable automatic application of updates. This ensures your system stays current without manual intervention. - download_updates: Choose whether your system downloads updates automatically. As a result, you can control bandwidth usage and update timing.
- emit_via: Decide how your system sends notifications, such as via email or system message. Therefore, you always know when updates are available or applied.
Here’s an example configuration to help you get started:
[commands]
apply_updates = yes
[emitters]
emit_via = motd
[base]
debuglevel = 1
Save and close the file when you finish editing. Next, you will enable and start the DNF Automatic timer.

More Detailed Configuration Examples
The /etc/dnf/automatic.conf
file offers a range of options to tailor DNF Automatic to your specific needs. Below are a few examples demonstrating common use cases. Remember to uncomment lines (remove the leading #
if present) and adjust values as needed.
Example 1: Apply Only Security Updates and Reboot if Needed
This configuration is ideal for servers or systems where minimizing downtime is crucial, but applying security patches promptly is a priority. It will only apply updates marked with a security advisory and will reboot the system if an update (like a kernel update) requires it.
[commands] # What kind of upgrades to look at: # default - All available updates # security - Only security updates upgrade_type = security # Whether packages comprising the available updates should be applied. # This implies download_updates is also yes. apply_updates = yes # When the system should reboot. # never - Do not reboot the system. # when-changed - Reboot after any upgrade. # when-needed - Reboot only if necessary (e.g., kernel or systemd update). reboot = when-needed # Maximal random delay before downloading, in seconds. # Useful to stagger updates on multiple systems. # random_sleep = 0 # Maximal time dnf-automatic will wait until the system is online, in seconds. # 0 means skip network availability detection. # network_online_timeout = 60 [emitters] # How to report results. Multiple emitters can be used. # stdio - Print to standard output (useful for manual runs or cron). # motd - Add to /etc/motd. # email - Send an email. # command_email - Send email using an external command. emit_via = motd [base] # Debug level for DNF. debuglevel = 1
Example 2: Download All Updates, Notify by Email, but Do Not Apply
This setup is useful if you want to review updates before they are applied. It downloads all available updates and sends an email notification. You would then need to apply the updates manually using sudo dnf upgrade
.
[commands] upgrade_type = default download_updates = yes apply_updates = no # Set to no, so updates are only downloaded [emitters] emit_via = email system_name = MyFedoraServer # Optional: Custom name for this system in reports [email] # Email address to send notifications from. email_from = root@$(hostname -f) # List of email addresses to send notifications to. # Separate multiple emails with a comma or space. email_to = your-email@example.com # Hostname of the SMTP server. email_host = localhost # Port number for the SMTP server. email_port = 25 # Whether to use TLS, STARTTLS, or no encryption. # Options: no, yes, starttls email_tls = no [base] debuglevel = 1
Note: For email notifications to work, your Fedora system must have a configured mail transfer agent (MTA) like Postfix or Sendmail, or be able to relay mail through an external SMTP server.
Example 3: Stagger Updates on Multiple Servers
If you manage multiple Fedora servers, you might want to prevent them from all trying to update at the exact same time. The random_sleep
option adds a random delay before DNF Automatic starts its process.
[commands] # ... other command settings ... apply_updates = yes # Maximal random delay, in seconds. 3600 seconds = 1 hour. random_sleep = 3600 # ...
This setting will make DNF Automatic wait for a random period up to one hour before checking for and applying updates, helping distribute network load and reducing the chance of simultaneous updates causing widespread issues if a problematic update is released.
Step 4: Enabling and Starting the DNF Automatic Timer on Fedora
DNF Automatic uses systemd timers to schedule update checks. Enable and start the timer with the following command. This step ensures that updates run on a regular schedule:
sudo systemctl enable --now dnf-automatic.timer
The --now
flag starts the service immediately, and enabling the timer ensures it runs on boot. To confirm the timer is running, check its status using the following command:
sudo systemctl status dnf-automatic.timer
Understanding Different DNF Automatic Timer Units
While dnf-automatic.timer
is the most common timer that relies on the /etc/dnf/automatic.conf
file for its behavior, Fedora provides other pre-configured timer units. These specialized timers override certain settings in the configuration file, offering standard behaviors for convenience:
dnf-automatic-notifyonly.timer
: This timer will only check for updates and report them according to your emitter settings (e.g., MOTD, email). It will not download or apply any updates, regardless of thedownload_updates
orapply_updates
settings inautomatic.conf
.dnf-automatic-download.timer
: This timer will check for and download available updates, making them ready for a manual install. It will not automatically apply the updates, even ifapply_updates = yes
is in your configuration.dnf-automatic-install.timer
: This timer will download and automatically install available updates. This is the most automated option and will apply updates even ifapply_updates
is set tono
in the main configuration file.
To use one of these specific timers, you enable it just like the default timer. For example, if you only want notifications without any downloads or installations, you would disable the default timer (if active) and enable the notify-only timer:
sudo systemctl disable --now dnf-automatic.timer
sudo systemctl enable --now dnf-automatic-notifyonly.timer
Choose the timer that best fits your update strategy. If you prefer full control via the automatic.conf
file, stick with dnf-automatic.timer
. If you prefer a standard behavior like “install all updates,” you might use dnf-automatic-install.timer
and not worry as much about the apply_updates
setting in the config file.
Step 5: Advanced Timer Configuration for DNF Automatic
By default, the dnf-automatic.timer
runs daily. If you need to customize this schedule, the recommended method is to override the default timer unit. Directly editing files in /usr/lib/systemd/system/
is discouraged as your changes might be overwritten by system updates. Instead, you can create a custom configuration using a “drop-in” snippet in /etc/systemd/system/
.
First, create the necessary directory for the drop-in snippet if it doesn’t already exist. Then, create an override file (e.g., override.conf
) using a text editor:
sudo mkdir -p /etc/systemd/system/dnf-automatic.timer.d/
sudo nano /etc/systemd/system/dnf-automatic.timer.d/override.conf
In the override.conf
file, you only need to specify the settings you want to change. For example, to adjust the schedule to check for updates every Monday at 3 AM, add the following content:
[Timer] OnCalendar= OnCalendar=Mon *-*-* 03:00:00
The first empty OnCalendar=
line is crucial; it clears any existing OnCalendar
assignments from the original unit file before applying your new one. The format Mon *-*-* 03:00:00
specifies execution every Monday at 3:00 AM. You can tailor this to your needs using the systemd calendar event format.
After creating or modifying the override file, save it. Then, instruct systemd to reload its configuration and restart the timer for your changes to take effect:
sudo systemctl daemon-reload
sudo systemctl restart dnf-automatic.timer
You can verify the timer’s next scheduled run time and see all its active settings (including your overrides) using sudo systemctl status dnf-automatic.timer
. To specifically check the OnCalendar
values, you can use systemctl show dnf-automatic.timer | grep OnCalendar
.
Testing and Troubleshooting DNF Automatic on Fedora
Testing DNF Automatic Updates on Fedora
To verify DNF Automatic is working as expected, manually trigger its operation. Open your terminal and run the following command. This test helps you confirm your configuration is correct:
sudo dnf-automatic
This command immediately executes the configured behavior, such as checking for updates, downloading them, or applying them based on your settings. Therefore, you can use this test to ensure your configuration works correctly.
Common Issues and Solutions
Service Not Starting
If the timer does not start as expected, check the logs for errors by running the following command. This helps you identify and resolve issues quickly:
journalctl -u dnf-automatic.timer
The logs often provide specific error messages related to misconfigurations or missing dependencies. Therefore, verify the dnf-automatic.timer
file is configured correctly, then reload the systemd daemon if necessary using the command below:
sudo systemctl daemon-reload
This command ensures your recent changes apply correctly. As a result, your timer should function as intended.
No Notifications Received
If you do not receive notifications, check the emit_via
option in the /etc/dnf/automatic.conf
file. This setting determines how your system sends notifications, such as via motd
(message of the day) or email
. In addition, make sure your notification method is supported and configured properly.
If you configure email notifications, make sure your mail system is installed and operational. Without a functioning mail server, your system cannot deliver email alerts. If necessary, test your mail setup separately to confirm it works. Otherwise, consider using another notification method.
Updates Not Applied
If your system does not apply updates automatically, verify you set the apply_updates
option in the configuration file to yes
. This setting enables DNF Automatic to install updates without manual intervention. Additionally, check the timer status to confirm it is active:
sudo systemctl status dnf-automatic.timer
If the timer is inactive, start it with the following command. This action should resolve the issue:
sudo systemctl start dnf-automatic.timer
Checking Update Logs and Manual Execution
To see a history of packages updated by DNF (including those by DNF Automatic), you can inspect the DNF RPM log. This can be helpful to confirm if and when updates were applied:
cat /var/log/dnf.rpm.log
For more detailed output from DNF Automatic itself, especially when testing configurations, you can check the system journal for its specific unit. For the default timer, this would be:
journalctl -u dnf-automatic.service
If you’re making many changes to your /etc/dnf/automatic.conf
and want to test them without waiting for the timer, you can run DNF Automatic directly from the command line. This will use the default configuration file:
sudo dnf-automatic
You can also point it to a custom configuration file if you want to test different settings without altering your main file:
sudo dnf-automatic /path/to/your-custom-dnf-automatic.conf
Best Practices for DNF Automatic on Fedora
- Start with Notifications Only: Configure DNF Automatic to send update notifications before you enable automatic installations. This helps you understand its behavior and avoid unexpected changes.
- Enable Security-Only Updates: Focus on security updates by setting the
upgrade_type
parameter in the configuration file. As a result, you can prioritize critical patches. - Monitor Logs Regularly: Check logs periodically to ensure your system applies updates without issues. Furthermore, regular monitoring helps you catch problems early.
- Test on Non-Critical Systems First: For production environments, test the tool on non-critical systems before you deploy it widely. This approach minimizes risk and ensures a smooth rollout.
Conclusion
DNF Automatic is a powerful tool that simplifies package management on Fedora. Successfully following this guide to install DNF Automatic on Fedora means you can now configure and test its capabilities, enabling seamless updates and enhanced system security. Ultimately, automating your updates saves time and keeps your system safe.
For further customization and advanced usage, refer to the official DNF Automatic documentation. Embrace the power of automation and enjoy a hassle-free Fedora experience!