google-chrome - 查找最新可用的 Chrome 版本(在 Linux 上,例如从 sh

如何从 Linux 上的 shell 脚本(例如 bash)找到最新版本的 Google Chrome?

对于 ChromeDriver,我可以这样做:

curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE

我可以为 Chrome 做类似的事情吗?


问题背景 吨 这需要在管道中完成,并且没有本地安装的 Chrome,也没有检查包的工具(rpm、deb 等)。我想要这个的原因是我可以下载最新版本的编号包。我可以做到这一点

wget -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

但这会生成一个名为 google-chrome-stable_current_amd64.deb 的文件,而不是带有版本标记的文件,例如 google-chrome-stable_73.0.3683.103-1_amd64.deb.

如果我提前知道版本,我可以使用这个得到一个带有版本标记的文件:

GOOGLE_CHROME_VERSION=73.0.3683.103-1
wget http://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${GOOGLE_CHROME_VERSION}_amd64.deb

所以我真正想要的是始终返回最新版本标记文件的通用 URL,或者在上面设置 GOOGLE_CHROME_VERSION 的方法。

最佳答案

如果你像我的 16.04 一样使用 Ubuntu 桌面,这里是命令

google-chrome --version

引用。 https://askubuntu.com/a/505532/22308

关于google-chrome - 查找最新可用的 Chrome 版本(在 Linux 上,例如从 shell 脚本),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57267473/

相关文章:

python-3.x - 如何修复Python3.7.1中的 "No module named '编

java - Spring Boot + Yaml + @PropertySource + @Con

javascript - 无法加载资源:net::ERR_CONNECTION_REFUSED 从本

javascript - 错误 [prerender-spa-plugin] - 无法预呈现所有路线

reactjs - 在 React BootStrap 中的行元素之间添加空格

visual-studio-app-center-distribute - 是否可以在 AppCen

python - 无法从 git 子模块导入

javascript - 是否可以禁用整个主体(包括内部 iFrame)的填写付款表格?

jpa - Spring Data JPA Projection嵌套列表投影接口(interface

android - 如何在 kotlin 中使用 http 请求将图像上传到服务器?