by

How to Manage Unattended Upgrades on Debian 10

Whenever some critical data resides on your system, the most important thing that you need to do is to ensure its security and safety. For doing that, you need to regularly install all the latest security patches and updates. However, it gets all the more convenient if these patches and updates get installed automatically. Fortunately, the unattended-upgrades utility in Debian 10 allows you to successfully achieve this objective. Therefore, today we will discuss the method of managing the unattended-upgrades in Debian 10.

Configure Unattended Upgrades on Debian 10

For managing the unattended-upgrades in Debian 10, you will need to perform the following steps:

First of all, you will need to launch the terminal in Debian 10. After launching the terminal successfully, the next thing that you are advised to do is to update your system before installing any new packages. For doing that, type the following command in your terminal and then press the Enter key:

sudo apt update

This command is shown in the image below:

As soon as this command will execute successfully, you will be able to see the message shown in the following image in your terminal:

Update packages

Now you will need to install the unattended-upgrades package. All you have to do in this regard is to type the following command in your terminal and then press the Enter key:

sudo apt install unattended-upgrades

This command is shown in the image below:

unattended upgrades

After the successful execution of this command, you will be able to see the following message on your terminal:

Install unattended upgrades package

The next thing that you need to do is to configure the unattended-upgrades by modifying the /etc/apt/apt.conf.d file. You can open this file with any of the text editors of your choice. However, in this example, we have opened this file with the help of the nano editor. For doing that, you will need to type the following command in your terminal and then press the Enter key:Advertisement

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

You need to pay special attention to the syntax of this command as an error or mistake while typing this command can lead to incorrect results. This command is also shown in the image below:

Edit the unattended upgrades configuration file

As soon as this command will execute successfully, the /etc/apt/apt.conf.d file will open up in the nano editor. Now you need to scroll down to the lines shown in the following image and uncomment them by removing the “//” (two forward slashes) before these lines:

Upgrade settings

Once you have uncommented these lines, press Ctrl+ X to save the newly made changes and exit from the nano editor. Now when the configuration of the unattended-upgrades is done, the next thing that you need to do is to enable the unattended-upgrades. For doing that, type the following command in your terminal and then press the Enter key:

sudo dpkg-reconfigure --priority=low unattended-upgrades

This command is also shown in the image below:

reconfigure package

The successful execution of this command will display a dialogue box on your terminal. Select the Yes option from this dialogue box by pressing the Enter key as shown in the following image:

Enable unattended upgrades

By now, the unattended-upgrades have been enabled on your Debian 10. However, you also need to ensure whether the above-mentioned process has worked correctly or not. For doing that, you need to check the status of your unattended-upgrades. Type the following command in your terminal and then press the Enter key:

sudo systemctl status unattended-upgrades.service

This command is also shown in the image below:

Check status of upgrade service

As soon as this command will execute successfully, you will be able to see the status of your unattended-upgrades. The Active (Running) status means that your unattended-upgrades have been enabled successfully as highlighted in the following image:

Unattended upgrades are active

Now if you want to disable the unattended-upgrades, then type the very same command in your terminal that you have typed for enabling these upgrades and then press the Enter key. As soon as you will do this, a dialogue box will appear on your terminal. This time, select the No option from this dialogue box and then press the Enter key to disable the unattended-upgrades as highlighted in the image shown below:

Disable automatic updates

As soon as this command will execute successfully, you will be able to see the message shown in the following image on your terminal:

Auto updates disabled

Conclusion

By following the method described in this article, you can easily manage the unattended-upgrades in Debian 10 and hence you can ensure the security of your critical systems in the best possible way.

Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

News Feed