Disable Automatic Update/Upgrade on Debian/Ubuntu through SSH or Desktop

mail
Cyrus Kao
Last modified

I login to my remote machine through ssh today and saw the message System restart required, which is very weird since I did not upgrade anything. Then I realized my Ubuntu Server has automatic upgrade enabled by default. Auto updating on a Linux server distro, truly a edgy feature.

To turn off automatic system upgrade and package lists update on your Debian/Ubuntu based Linux distros is quite easy. And we'll be covering editing apt configuration through both CLI (Command-Line Interface) and GUI (Graphical User Interface) so it can be done by ssh or desktop.

Disable Auto System Upgrade

To disable automatic system upgrade, simply by editing /etc/apt/apt.conf.d/20auto-upgrades and change APT::Periodic::Unattended-Upgrade to 0.

CLI (Command-Line Interface)

Open 20auto-upgrades with vim or your preferred text editor:

sudo vim /etc/apt/apt.conf.d/20auto-upgrades
Bash

Change APT::Periodic::Unattended-Upgrade to 0 then save:

APT::Periodic::Unattended-Upgrade "0";
Plain text

GUI (Graphical User Interface)

Open your terminal by Ctrl-Alt-T then open 20auto-upgrades with gedit:

gedit admin:/etc/apt/apt.conf.d/20auto-upgrades
Bash

Change APT::Periodic::Unattended-Upgrade to 0 then save:

20auto-upgrades
Editing 20auto-upgrades with gedit

Disable Auto Package Lists Update

To disable automatic package lists update, change APT::Periodic::Update-Package-Lists to 0 in both /etc/apt/apt.conf.d/20auto-upgrades and /etc/apt/apt.conf.d/10periodic.

CLI (Command-Line Interface)

Open 20auto-upgrades with vim or your preferred text editor:

sudo vim /etc/apt/apt.conf.d/20auto-upgrades
Bash

Change APT::Periodic::Update-Package-Lists to 0 then save:

APT::Periodic::Update-Package-Lists "0";
Plain text

And repeat the process on 10periodic:

sudo vim /etc/apt/apt.conf.d/10periodic
Bash

Change APT::Periodic::Update-Package-Lists to 0 then save:

APT::Periodic::Update-Package-Lists "0";
Plain text

GUI (Graphical User Interface)

Open your terminal by Ctrl-Alt-T then open 20auto-upgrades with gedit:

gedit admin:/etc/apt/apt.conf.d/20auto-upgrades
Bash

Change APT::Periodic::Update-Package-Lists to 0 then save:

20auto-upgrades
Editing 20auto-upgrades with gedit

Open 10periodic with gedit:

gedit admin:/etc/apt/apt.conf.d/10periodic
Bash

Change APT::Periodic::Update-Package-Lists to 0 then save:

10periodic
Editing 10periodic with gedit

Comments

0500