如何启用Google Chrome的无提示自动更新?


22

安装Google Chrome浏览器会导致添加第三方软件源,可从中获取Google Chrome升级:

$ 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

如何从该存储库启用无人值守升级?

Answers:


39
  1. 安装无人值守的升级:

    sudo apt-get install unattended-upgrades
    
  2. 通过编辑无人参与的升级列表并在其中添加Google Chrome仓库,在Google Chrome仓库上启用无人参与的更新:

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

    添加"Google\, Inc.:stable";到允许的来源:

    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\, Inc.:stable";
    };
    
  3. 测试

    使用sudo unattended-upgrade --dry-run测试,如果都挺清楚的,你应该是具有更新,而不需要您进行任何干预安装谷歌浏览器。

要在空运行后检查日志是否正常运行,请执行以下操作:

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

并且您应该在日志中看到与此类似的内容:

2011-10-11 18:03:23,292信息允许的来源是:['o = Ubuntu,a = oneiric-security','o = Google,Inc.,a = stable']

您可以通过编辑文件来更改无人参与更新/etc/apt/apt.conf.d/10periodic的配置,配置选项位于/etc/cron.daily/apt脚本头中。阅读它们以配置无人值守更新的频率。


7
截至2018年10月,谷歌已更改其存储库的名称。将字符串从更改"Google\, Inc.:stable";"Google LLC:stable";
user535733 '18

1
对于Ubuntu 18+及更高版本的Debian gksudo,已弃用并从回购协议中删除,我建议在此答案中将gksudo替换为sudo gedit /etc/apt/apt.conf.d/50unattended-upgrades
google-frank-dspeed
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.