Disabling update-notifier in Ubuntu 12.04

My team manages a number of user workstations running Ubuntu 12.04 “Precise Pangolin”. We install a standard APT configuration which automatically upgrades these PCs as soon as packages are available, without prompting and without a GUI. Therefore we also need to disable the update-notifier so it doesn’t display these packages to the user.

This isn’t necessary if your user doesn’t have admin access (is a member of the sudo group). Update-notifier won’t run if you don’t have sudo.

Method 1: Prevent update-notifier from starting at login

As the user, open a terminal and run:

mkdir -p ~/.config/autostart
cp /etc/xdg/autostart/update-notifier.desktop ~/.config/autostart/
editor ~/.config/autostart/update-notifier.desktop

Find this line:

X-GNOME-Autostart-Delay=60

And replace it with:

X-GNOME-Autostart-enabled=false

Now log out and in again, or kill the running update-notifier:

killall update-notifier

Or just paste all this into the shell:

mkdir -p ~/.config/autostart
cp /etc/xdg/autostart/update-notifier.desktop ~/.config/autostart/
sed -i 's/X-GNOME-Autostart-Delay=60/X-GNOME-Autostart-enabled=false/' ~/.config/autostart/update-notifier.desktop
killall update-notifier

Method 2: Prevent update-notifier from starting at login for all users

The above method works only on the user that is currently logged in. This is useful if you have a one-user workstation. But if you want to make a system-wide change, run:

sudo sed -i 's/X-GNOME-Autostart-Delay=60/X-GNOME-Autostart-enabled=false/' /etc/xdg/autostart/update-notifier.desktop

Method 3: Let update-notifier run, but disable notifications

This method allows update-notifier to run in the background, but tells it not to display notifications. As the first method, this only works on the current user.

  • Start dconf-editor from the Unity menu or run dialog.
  • Browse to “com.ubuntu.update-notifier”.
  • Set “no-show-notifications” to true.

Or just run this handy command:

gsettings set com.ubuntu.update-notifier no-show-notifications true

Enabling automatic security updates without update-notifier

If you’ve done the above and still want security updates, do the following. First Create /etc/apt/apt.conf.d/20auto-upgrades containing:

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

Then edit /etc/apt/apt.conf.d/50unattended-upgrades and uncomment or add:

Unattended-Upgrade::Allowed-Origins {
	"${distro_id} ${distro_codename}";
	"${distro_id} ${distro_codename}-security";
	"${distro_id} ${distro_codename}-updates";
};

Tags: , ,

  1. Alan Phillips’s avatar

    You can also disable this through the GUI updater, can’t you? Under “Settings”?

    Reply

    1. Tyler Wagner’s avatar

      Yes, but that also disables GUI-less unattended-upgrades. The above method just disables the user GUI.

      My use case is corporate, not the more common “single user who is his own admin”.

      Reply

    2. Christophe Blaess’s avatar

      Thank you for this article. It’s very useful.
      I am very interested in the last configuration, I’ll use it for standalone remote stations (with single dedicated graphical application).

      Reply

Reply

Your email address will not be published.

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