How can I enable silent automatic updates for Google Chrome?

18,164

Solution 1

  1. Install unattended upgrades:

    sudo apt-get install unattended-upgrades
    
  2. Enable unattended updates on the Google Chrome repo by editing the unattended upgrades list and adding the Google Chrome repo in it:

    sudo gedit /etc/apt/apt.conf.d/50unattended-upgrades
    

    Add "Google\, Inc.:stable"; to the allowed origins:

    Unattended-Upgrade::Allowed-Origins {
        "${distro_id} ${distro_codename}-security";
    //  "${distro_id} ${distro_codename}-updates";
    //  "${distro_id} ${distro_codename}-proposed";
    //  "${distro_id} ${distro_codename}-backports";
     "Google LLC:stable";
    };
    
  3. Test

    Use sudo unattended-upgrade --dry-run to test, if all came clear you should be having updates to Google Chrome installed without any intervention from you.

To check that it's working tail the log after the dry run:

cat /var/log/unattended-upgrades/unattended-upgrades.log

and you should see something along the lines of this in your log:

2011-10-11 18:03:23,292 INFO Allowed origins are: ['o=Ubuntu,a=oneiric-security', 'o=Google, Inc.,a=stable']

You can change the configuration of the unattended updates by editing the file /etc/apt/apt.conf.d/10periodic, options for the configuration are in the /etc/cron.daily/apt script header. Read them to configure the frequency of the unattended updates.

Solution 2

Edit /etc/apt/apt.conf.d/50unattended-upgrades and add a line inside Origins-Pattern:

Unattended-Upgrade::Origins-Pattern {
        // Keep existing content here, just add:
        "origin=Google LLC,codename=stable";                              
}
Share:
18,164

Related videos on Youtube

RusGraf
Author by

RusGraf

My goal here is usually to document.

Updated on September 18, 2022

Comments

  • RusGraf
    RusGraf over 1 year

    Installing Google Chrome causes a third-party software source to be added from which Google Chrome upgrades can be retrieved:

    $ cat /etc/apt/sources.list.d/google-chrome.list
    ### THIS FILE IS AUTOMATICALLY CONFIGURED ###
    # You may comment out this entry, but any other modifications may be lost.
    deb http://dl.google.com/linux/chrome/deb/ stable main
    
    $ head -n 9 /var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_Release
    Origin: Google, Inc.
    Label: Google
    Suite: stable
    Codename: stable
    Version: 1.0
    Date: Tue, 04 Oct 2011 00:57:43 +0000
    Architectures: i386 amd64
    Components: main
    Description: Google chrome-linux repository.
    
    $ grep '^Package: ' /var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages 
    Package: google-chrome-beta
    Package: google-chrome-stable
    Package: google-chrome-unstable
    

    How can I enable unattended upgrades from this repository?

  • user535733
    user535733 over 5 years
    As of October 2018, Google has changed the name of it's repository. Change the string from "Google\, Inc.:stable"; to "Google LLC:stable";
  • frank-dspeed
    frank-dspeed over 5 years
    for Ubuntu 18+ and newer Debian gksudo got deprecated and removed from the repos use i suggest to replace gksudo in this answer with sudo gedit /etc/apt/apt.conf.d/50unattended-upgrades
  • tianon
    tianon over 3 years
    If you want to avoid having to merge conflicts when unattended-upgrades is updated (or reconfigured), you can create a new file in /etc/apt/apt.conf.d that contains Unattended-Upgrade::Origins-Pattern:: "origin=Google LLC"; instead (it just needs to sort later than 50unattended-upgrades such as /etc/apt/apt.conf.d/google-chrome).