27

Is there any gsettings schema to select "Never" on

system settings->software and updates->updates->automatically check for updates

Any other command line option to disable automatic updates is right for me.

Thank You

3

5 Answers 5

31

According to this post

Disable apt-daily.service:

systemctl stop apt-daily.timer
systemctl disable apt-daily.timer
systemctl disable apt-daily.service
systemctl stop apt-daily-upgrade.timer
systemctl disable apt-daily-upgrade.timer
systemctl disable apt-daily-upgrade.service

Or

systemctl disable --now apt-daily{,-upgrade}.{timer,service}

The annoying update notifier can be simply removed by following command:

sudo apt purge update-notifier-common

Further if you want to stop automatic security updates run

sudo apt purge  unattended-upgrades

Ubuntu 20.04

  • On Ubuntu I had some problem disabling the daily update. The update gets triggered by systemctl which triggers anacron and starts the script /etc/cron.daily/apt-compat. I commented out the last line

    # exec /usr/lib/apt/apt.systemd.daily
    

which stops running the update.

  • Further I had also to stop the autostart of discovery by running following commands:

    sudo mkdir /etc/xdg/autostart/disable
    sudo mv /etc/xdg/autostart/org.kde.discover.notifier.desktop /etc/xdg/autostart/disable
    
4
  • 3
    The other command seems to work... Apr 22, 2019 at 7:40
  • 1
    What "other command?"
    – mr.zog
    Oct 24, 2019 at 16:01
  • 2
    @mr.zog I'm guessing systemctl disable --now apt-daily{,-upgrade}.{timer,service} @abu_bua @AleksandarPavić please confirm. Apr 27, 2020 at 17:14
  • sudo sed -e '/exec \/usr\/lib\/apt\/apt.systemd.daily/ s/^#*/#/' -i /etc/cron.daily/apt-compat for commenting the exec line with sed Oct 15, 2021 at 22:30
10

Thanks to suggestions from Norbert and doug I came up with this solution:

sudo sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/' /etc/apt/apt.conf.d/20auto-upgrades
2
  • Result for me on 18.04 : "can't read /etc/apt/apt.conf.d/20auto-upgrades: No such file or directory", can I simply create the file? Or does it exist under another file name?
    – Meloman
    Dec 16, 2020 at 9:06
  • that's weird.. I have couple of machines with Ubuntu 18.04 and all of them have that file..you'd better open a new question on this..
    – rok
    Dec 16, 2020 at 9:18
6

No, there is no gsetting for this. In 16.04 those relevant options are set in the /etc/apt/apt.conf.d/10periodic file

Obviously the easiest way to alter is thru Software & Updates > Updates which edits that file if you change from default.

You can edit that file manually if desired or fashion some command to set the option(s) to false ("0"

Edit /etc/apt/apt.conf.d/20auto-upgrades to disable automatic updates from the command line:

$ sudo nano /etc/apt/apt.conf.d/20auto-upgrades

Once you have the file opened, switch off the Update-Package-Lists directive from 1 to 0 as shown below:

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "1";
1
  • 1
    This file doesn't exist.
    – Cerin
    Dec 3, 2020 at 21:30
3
sudo dpkg-reconfigure unattended-upgrades

worked for me with Ubuntu 16.04 server. It created the following output:

Replacing config file /etc/apt/apt.conf.d/20auto-upgrades with new version

After the reconfig (disable auto-updates), 20auto-upgrades contained this:

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";
1
  • Could you improve your answer (editing it) specifying in which version of Ubuntu you tested this solution? In this way, who reach this topic may use one solution or the other according to the Ubuntu version in own machine. Aug 27, 2020 at 7:40
1

In Ubuntu 18.04 (LUbuntu) I had no easy way to do it, but to symlink to true:

mv /usr/bin/update-manager /usr/bin/update-manager.bak # if needed
ln -s /bin/true /usr/bin/update-manager

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .