Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to handle automatic unattended upgrades in Ubuntu

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to handle automatic unattended upgrades in Ubuntu. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Sometimes, when you try to shut down the Ubuntu system, you may see this page that prevents you from shutting down:

An unattended upgrade is in progress during the shutdown process, please do not turn off the computer.

You may ask what this "unattended upgrade" is and how it can run without your knowledge.

The reason is that Ubuntu attaches great importance to the security of the system. By default, it automatically checks for system updates every day, and if it finds security updates, it downloads them and installs them itself. For normal system and application updates, it will notify you through the software update program.

Since all of this happens in the background, you won't even realize it until you try to shut down the system or try to install the application yourself.

During these unattended upgrades, trying to install new software can lead to the famous failure to get a lock.

As you can see, automatic updates bring a little trouble. You can choose to disable automatic updates, but this means that you must always manually check and update your Ubuntu system.

Do you really need to disable automatic updates?

Please note that this is a security feature. Linux actually allows you to disable all the features in the system, or even disable these security features.

But I don't think you should disable automatic updates as a regular user. After all, it can ensure the security of your system.

In order to ensure the security of the system, you can put up with the small hassle of automatic updates.

Now that you've been warned, it's better to take on the extra task of updating the system manually, so let's see how to deal with automatic updates.

As usual, there are two ways to do this: GUI and the command line. I'm going to show you two ways.

I use Ubuntu 20.04 here, but these steps work for Ubuntu 18.04 and any other Ubuntu version.

Method 1: disable automatic updates in Ubuntu graphically

Go to the menu and find the "Software and updates" tool.

Here, go to the Update tab. Look for automatic check for updates. By default, it is set to Daily.

You can change it to "never" and your system will never check for updates. If you don't check for updates, it won't find the new updates to install.

If you do so, you must manually update the system from time to time. But this is extra work, and you may not always remember.

A better way to handle automatic updates in Ubuntu

Personally, I suggest it check for updates on its own. If you do not want it to install updates automatically, you can change this behavior to notify you of the availability of security updates.

Keep automatic check for updates to Daily, and then change the option when there are security updates to Show now instead of automatically download and install.

In this way, it will check for updates instead of automatically installing them in the background, and the software update will notify you that there are updates available to the system. And your system has completed normal system and software updates.

With this setting, you will not see an "unattended upgrade in progress" when you shut down the system. However, because two different processes cannot use the apt package manager at the same time, you may still encounter an "unable to lock" error.

I believe this is a better solution, don't you think?

As I promised to have both GUI and command-line methods, let me show you how to disable unattended upgrades on terminals.

How to use the command line to disable automatic updates in Ubuntu

You can find automatic upgrade settings in / etc/apt/apt.conf.d/20auto-upgrades. The default text editor in the Ubuntu terminal is Nano, so you can edit this file using the following command:

Sudo nano / etc/apt/apt.conf.d/20auto-upgrades

Now, if you don't want the system to check for updates automatically, you can change the value of APT::Periodic::Update-Package-Lists to "0".

APT::Periodic::Update-Package-Lists "0"; APT::Periodic::Unattended-Upgrade "0"

If you want it to check for updates but not automatically install unattended upgrades, you can choose to set it to:

APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "0"; finally

For some reason, automatic security updates are enabled, and it is recommended that you keep this state. This small annoyance is actually not worth the risk of compromising the security of the system.

Thank you for reading! This is the end of the article on "how to deal with automatic unattended upgrades in Ubuntu". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report