背景:

因测试需要限制谷歌浏览器版本,查询资料删除了谷歌文件中的自动更新文件

~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle

但是后来又想要体验一下新版的,后面想要升级发现重新下载最新版,也无法自动升级

恢复谷歌自动更新_Google

解决方式

~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle

进入该目录下,修改配置文件,修改配置,记得先备份

保存之后双击运行GoogleSoftwareUpdate.bundle这个文件,运行前记得先关闭谷歌浏览器

#!/bin/bash
#
# CheckForUpdatesNow.command
# Google Software Update
#

# Determine directory where this script is running from
script_dir=$(dirname $(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,"))

agent="$script_dir"/GoogleSoftwareUpdateAgent.app/Contents/MacOS/GoogleSoftwareUpdateAgent

if [ ! -x "$agent" ]; then
    echo "Can't figure out how to update now."
    exit 1
fi

"$agent" -runMode oneshot -userInitiated YES -updateCheckPeriod 86400 "$@"
# 加了一个新的参数 -updateCheckPeriod 86400。这个参数用于设置自动更新检查的时间间隔,单位为秒

再次打开发现已经在更新中了

恢复谷歌自动更新_Google_02