如何禁止 Google Chrome 自动更新 (macOS, Linux, Windows)

请访问原文链接:https://sysin.org/blog/disable-chrome-auto-update/,查看最新版。原创作品,转载请保留出处。

作者:gc(at)sysin.org,主页:www.sysin.org

如何禁用 Mozilla FireFox 自动更新

如何禁用 Microsoft Edge 自动更新

如何禁用 Google Chrome 自动更新

未经用户允许自动更新,也不提供选项禁用自动更新,属实不文明不举,以下方法可以禁用自动更新。

Google Chrome for Mac

Chrome for Mac 如何自动更新?

通过以下进程:

~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/GoogleSoftwareUpdateAgent.app
~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/GoogleSoftwareUpdateAgent.app via ~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksfetch
/Applications/Google Chrome.app via ~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksfetch
~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksfetch

访问 Google 相关域名检测并下载更新。

tools.google.com #主要(SYSIN)
update.googleapis.com #某些版本适用

解决方案:

  • 屏蔽进程网络访问
  • 删除进程并禁止重新生成
  • hosts 屏蔽相关域名

禁用自动更新一般步骤

1.删除和设置权限

打开终端执行如下命令:

cd ~/Library/Google/GoogleSoftwareUpdate
rm -rf GoogleSoftwareUpdate.bundle

cd ~/Library/Google
sudo chown root:wheel GoogleSoftwareUpdate

2.编辑 hosts 文件,添加如下内容:

手动编辑,打开终端,执行:sudo vi /etc/hosts,或者使用 SwitchHosts!(免费软件)

127.0.0.1 update.googleapis.com
127.0.0.1 tools.google.com

以上两步任意一个已经可以屏蔽自动更新,同时操作更加保险。

3.或者(或同时)使用防火墙软件屏蔽:

推荐 Little Snitch,这是一个商业软件

分别新建规则,屏蔽以下进程访问网络:

~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/GoogleSoftwareUpdateAgent.app
~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/GoogleSoftwareUpdateAgent.app via ~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksfetch
/Applications/Google Chrome.app via ~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksfetch
~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksfetch

Process Name:上述进程名

Deny Outgoing Connections

To: Any Server

效果图:

About Chrome for macOS

Google Chrome for Linux

Chrome Linux 版(deb 和 rpm)并没有自动更新功能。

Linux 软件更新通常依赖于系统级别的包管理机制(例如 apt 和 yum),我们可以手动来控制是否更新。

Chrome 稳定版在 Linux 中的软件包名称为:google-chrome-stable

在 Debian 及衍生系统中禁用 Chrome 更新:

sudo apt-mark hold google-chrome-stable
# 恢复
#sudo apt-mark unhold google-chrome-stable

在 Redhat 及衍生系统中禁用 Chrome 更新:

echo 'exclude=google-chrome-stable' >> /etc/yum.conf
# 恢复
#编辑 /etc/yum.conf 删除 exclude=google-chrome-stable

Google Chrome for Windows

Chrome for Windows 如何自动更新?

当前以 Chrome 88.0 版本为例,新版本将来可能有所变更:

Chrome 在 Windows 平台同时发布两个版本,分别是:

企业版即 Windows System Setup,安装在 Program Files 文件夹下,需要管理员权限安装;

用户版即 Windows User Setup,安装在 Users 文件夹下,不需要管理员权限,普通用户就可以安装。

企业版使用以下方法进行自动更新

更新服务:
Google 更新服务 (gupdate)
Google 更新服务 (gupdatem)
Google Chrome Elevation Service (GoogleChromeElevationService)

任务计划:
GoogleUpdateTaskMachineCore
GoogleUpdateTaskMachineUA

安装路径:
x64
C:\Program Files\Google\Chrome\Application\chrome.exe
x86
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

GoogleUpdate.exe 路径:
x64 和 x86 版本相同
C:\Program Files (x86)\Google\Update\GoogleUpdate.exe

根据上述路径,手动禁用或者删除即可禁用自动更新。

用户版不带自动更新程序

用户版安装路径:
C:\Users\用户名\AppData\Local\Google\Chrome\Application\chrome.exe

使用 PowerShell 禁用更新

打开 PowerShell 直接复制以下脚本运行一下更加方便:

if ([Environment]::Is64BitOperatingSystem -eq "True") {
    #Write-Host "64-bit OS"
    $PF=${env:ProgramFiles(x86)}
}
else {
    #Write-Host "32-bit OS"
    $PF=$env:ProgramFiles
}

if ($(Test-Path "$env:ProgramFiles\Google\Chrome\Application\chrome.exe") -eq "true") {
    # 结束进程
    taskkill /im chrome.exe /f
    taskkill /im GoogleUpdate.exe /f
    # Google Chrome 更新服务(SYSIN)
    #这里也可以使用 sc.exe stop "service name"
    Stop-Service -Name "gupdate"
    Stop-Service -Name "gupdatem"
    Stop-Service -Name "GoogleChromeElevationService"
    # Windows 10 默认 PS 版本 5.1 没有 Remove-Service 命令
    # This cmdlet was added in PS v6. See https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6#cmdlet-updates.
    #Remove-Service -Name "gupdate"
    #Remove-Service -Name "gupdatem"
    #Remove-Service -Name "GoogleChromeElevationService"
    # sc 在 PowerShell 中是 Set-Content 别名,所以要使用 sc.exe 否则执行后无任何效果
    sc.exe delete "gupdate"
    sc.exe delete "gupdatem"
    sc.exe delete "GoogleChromeElevationService"
    # 任务计划企业版
    schtasks.exe /Delete /TN \GoogleUpdateBrowserReplacementTask /F
    schtasks.exe /Delete /TN \GoogleUpdateTaskMachineCore /F
    schtasks.exe /Delete /TN \GoogleUpdateTaskMachineUA /F
    # 移除更新程序
    Remove-Item "$PF\Google\Update\" -Recurse  -Force
    Write-Output "Disable Google Chrome Enterprise x64 Auto Update Successful!"
}
elseif ($(Test-Path "${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe") -eq "true") {
    # 结束进程
    taskkill /im chrome.exe /f
    taskkill /im GoogleUpdate.exe /f
    # Google Chrome 更新服务
    #这里也可以使用 sc.exe stop "service name"
    Stop-Service -Name "gupdate"
    Stop-Service -Name "gupdatem"
    Stop-Service -Name "GoogleChromeElevationService"
    # Windows 10 默认 PS 版本 5.1 没有 Remove-Service 命令
    # This cmdlet was added in PS v6. See https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6#cmdlet-updates.
    #Remove-Service -Name "gupdate"
    #Remove-Service -Name "gupdatem"
    #Remove-Service -Name "GoogleChromeElevationService"
    # sc 在 PowerShell 中是 Set-Content 别名,所以要使用 sc.exe 否则执行后无任何效果
    sc.exe delete "gupdate"
    sc.exe delete "gupdatem"
    sc.exe delete "GoogleChromeElevationService"
    # 任务计划企业版
    schtasks.exe /Delete /TN \GoogleUpdateBrowserReplacementTask /F
    schtasks.exe /Delete /TN \GoogleUpdateTaskMachineCore /F
    schtasks.exe /Delete /TN \GoogleUpdateTaskMachineUA /F
    # 移除更新程序
    Remove-Item "$PF\Google\Update\" -Recurse  -Force
    Write-Output "Disable Google Chrome Enterprise x86 Auto Update Successful!"
}
else {
    Write-Output "No Google Chrome Enterprise Installation Detected!"
}

效果图:

About Chrome for Windows

下载 Chrome

Google Chrome 策略配置

Google Chrome 下载

备注:Chrome 内置多国语言界面。

macOS 最新稳定版固定下载地址

Chrome for macOS with Intel chip

Chrome for macOS with Apple chip

Linux 最新稳定版固定下载地址

Chrome for Linux – deb

Chrome for Linux – rpm

Windows System Setup 最新稳定版固定下载地址

(安装在 Program Files 文件夹下,需要管理员权限安装)

Google Chrome System Setup x86 - 32bit

Google Chrome System Setup x64 - 64bit

Windows User Setup (安装在 Users 文件夹下)

即下面的 Google Chrome for single user account,需要文明访问。
可以搜索第三方网站查看无需文明访问的链接(SYSIN)。

用户版不带自动更新程序。解压即为绿色版。

Windows MSI 安装包,企业版

附录

posted @ 2022-01-06 16:21  sysin  阅读(858)  评论(0编辑  收藏  举报