請訪問原文鏈接:https://sysin.org/blog/disable-chrome-auto-update/,查看最新版。原創作品,轉載請保留出處。
作者:gc(at)sysin.org,主頁:www.sysin.org
未經用戶允許自動更新,也不提供選項禁用自動更新,屬實不文明不舉,以下方法可以禁用自動更新。
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
效果圖:
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!"
}
效果圖:
下載 Chrome
Google Chrome 下載
備注:Chrome 內置多國語言界面。
macOS 最新穩定版固定下載地址
Chrome for macOS with Intel chip
Chrome for macOS with Apple chip
Linux 最新穩定版固定下載地址
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)。
用戶版不帶自動更新程序。解壓即為綠色版。