如何为Google Chrome启用静音自动更新?

安装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 

如何从此存储库启用无人参与的升级?

  1. 安装无人值守升级:

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

     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进行测试,如果一切sudo unattended-upgrade --dry-run ,您应该安装Google Chrome的更新,而无需您的任何干预。

在干运行后检查它是否正常工作:

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

你应该在日志中看到类似的内容:

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

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