Ubuntu Sneaky Unattended Upgrades

Vickneswaran Ezhilraj
2 min readJul 14, 2021
Generic Ubuntu 20.04 Banner

Disable Automatic Updates on Ubuntu 20.04 step by step instructions

Warning: Disabling automatic updates comes with a security risk. Do it on your own risk and only when you know what you are upto

Once automatic updates are disabled, We have to manually use $ sudo apt update and $ sudo apt upgrade to keep your system updated. Thats on you!

There are some situations when you may want to disable automatic updates. For example if you receive these error messages:

Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

The above is a result of a triggered automatic updates procedure where apt locked down the /var/lib/apt/lists/lock file, thus the administrator is prevented from installing new packages and is forced to wait until the automatic updates refresh cycle is completed.

(This happened to me when using packer to build a VM and unattended upgrades killed my time around 6 to 9 mins each time for building the VM)

How to disable Automatic Updates from command line

Open and edit the file /etc/apt/apt.conf.d/20auto-upgrades

$ sudoedit /etc/apt/apt.conf.d/20auto-upgrades

Change the configs

From:

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

To:

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "0";

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Vickneswaran Ezhilraj
Vickneswaran Ezhilraj

Written by Vickneswaran Ezhilraj

Livin 4 Endorphins, Oxytocin, Serotonin n Dopomine #dancer #wanderer #softwaredev #musicProducer #graffitiArtist #petfather soundcloud.app.goo.gl/L7cRf

No responses yet

Write a response