Home Ubuntu How To Disable Unattended Upgrades On Ubuntu

How To Disable Unattended Upgrades On Ubuntu

By sk
Published: Updated: 79.1K views

I have different versions of Ubuntu VMs for testing purposes. As you may already know, Ubuntu has a feature named Unattended Upgrades, which installs the latest security (and other) updates automatically whenever they are available. It comes preinstalled and enabled by default in the recent Ubuntu versions.

While this feature helps to keep the Ubuntu system up-to-date, it also quite annoying some times. For instance, when I am about to install a new application as soon as I logged in to my Ubuntu VM, I always get this message:

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Unable to acquire the dpkg frontend lock error in Ubuntu

Unable to acquire the dpkg frontend lock error in Ubuntu

This is because the unattended upgrades process is running in the background and it is downloading and installing the security updates. I can't perform any apt operations until this process is complete.

This is OK if the update size is small. But If I run the VM after one or two months, the size of the updates is likely bigger and it takes really a long time to complete.

It also doesn't let me to reboot or shutdown my system when I am in a hurry. This is what I get if I try to shutdown or restart my Ubuntu system:

A stop job is running for Unattended Upgrades Shutdown (10s / 30 min)
A stop job is running for Unattended Upgrades Shutdown

A stop job is running for Unattended Upgrades Shutdown

Even I forcibly reboot the system, I get the following error when try to install any applications.

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem errors.

I don't know about you, but it is becoming quite annoying feature for me. This happened to me so many times. Every time, I had to wait several minutes before performing an apt operation.

If you're like me and annoyed of this feature, you can disable the Ubuntu's unattended upgrades feature as described below.

Disable unattended upgrades on Ubuntu

To disable unattended upgrades on Ubuntu and its derivatives, run:

$ sudo dpkg-reconfigure unattended-upgrades

Choose No and hit ENTER to disable unattended upgrades.

Disable Unattended Upgrades On Ubuntu

Disable Unattended Upgrades On Ubuntu

You can also remove it altogether if you don't want it anymore.

$ sudo apt remove unattended-upgrades

It doesn't remove any other software on your Ubuntu system, so it is safe to remove unattended upgrades package.

From now on, your Ubuntu system doesn't automatically download and install important updates. You have to manually download and install updates once in a while by using commands:

$ sudo apt update
$ sudo apt upgrade

The Unattended Upgrades feature is enabled by default and it runs at system boot without user's permission. This might be helpful for casual users who wants to keep their system up-to-date without user-intervention. But for testing systems, It is completely unnecessary, so I disabled it in all my Ubuntu VMs.

Related read:

You May Also Like

8 comments

Jim March 19, 2020 - 3:54 pm

I removed unattended upgrades months ago out of frustration, with no problems. Now I can upgrade when I want.

Reply
Angel G June 3, 2020 - 2:25 pm

Thank you for sharing this. Interestingly it is not an Ubuntu-only feature. Debian has it as well.
And it makes Linux to annoy users as Windows 10 does.

Reply
pertain August 13, 2020 - 10:24 pm

Great tips, thanks! The reason we choose Ubuntu is that we want to fully control our OS, not the opposite. I am not happy with Ubuntu doing this to me.

Reply
Edg October 22, 2020 - 8:54 am

Thank you thank you thank you.

Reply
bill October 31, 2020 - 2:42 am

try installing ubuntu’s own provided raspberry pi (the so called preinstalled images). as soon as you boot pi, its going to believe it hasnt been updated in months. even tho its a fresh system. now with IO rate of a sd card and 1 ghz cortex whatever, good luck waiting 5 hrs before you are allowed to work w/ apt.

Reply
Leo February 1, 2021 - 9:42 pm

Thanks. This just locked my webserver’s database while updating the mysqlclient in the middle of the day!

Reply
jim February 18, 2021 - 8:43 pm

while it’s a great feature, it annoyed the crap out of me when working on test servers/equipment. sometimes i need to keep the same versions/kernels!!

Reply
Simon Reed September 12, 2021 - 6:05 pm

Thank you. I just discovered this awful ‘feature’. Apps started crashing randomly. In one of the failure reports it mentioned incompatible packages. On starting a manual update was when I found it had run a partial update three days earlier as some parts of the unattended upgrade had failed. Since apps kept crashing, I rebooted. It came up on VGA mode! And only on one of the monitors! It seems it tried to update a nVidia driver and failed. So I rebooted into the earlier version of the shell thinking I might be able to fix it from there and that also is in VGA mode now.

One of the reasons I stopped using Windows many many years ago was because they assumed THEY could do things to MY machine because they thought they knew better, but often did not. I see the Ubuntu developers have now got to the same level of incorrect arrogance.

I wonder how many more hours I will waste trying to diagnose and fix this developer-created problem?

Why, why, why would anyone want a secret, silent and invisible upgrade function that does not tell you when it has failed? Twats.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More