在 Ubuntu 26.04 上安装 Google Chrome 网页浏览器(官方 .deb 包与 APT 仓库)

Google Chrome 是一款快速的网页浏览器,内置 Google 账户同步、自动更新、密码管理,并支持现代 Web 应用。由于它是专有软件,并未包含在标准的 Ubuntu 软件源中。

本指南讲解如何在 Ubuntu 26.04 上使用 Google 官方 .deb 软件包安装 Google Chrome。

快速参考

TaskCommand
下载软件包wget "https://dl.google.com/linux/direct/google-chrome-stable_current_$(dpkg --print-architecture).deb"
安装软件包sudo apt install "./google-chrome-stable_current_$(dpkg --print-architecture).deb"
启动 Chromegoogle-chrome
设为默认浏览器xdg-settings set default-web-browser google-chrome.desktop
更新 Chromesudo apt update && sudo apt upgrade
卸载 Chromesudo apt remove google-chrome-stable
移除 Chrome 及其仓库sudo apt purge google-chrome-stable
检查仓库文件cat /etc/apt/sources.list.d/google-chrome.sources

在 Ubuntu 上安装 Google Chrome

官方的 Chrome 软件包会安装浏览器并配置 Google APT 仓库,以便未来的更新通过正常的 Ubuntu 更新流程送达。

下载 Google Chrome

首先,检查你的 Ubuntu 安装使用的是 amd64 还是 arm64 架构:

dpkg --print-architecture

接下来,使用 wget 下载该架构的最新稳定版软件包:

wget 
"https://dl.google.com/linux/direct/google-chrome-stable_current_
$(
dpkg --print-architecture
)
.deb"

该命令会把 dpkg 报告的架构插入到软件包名称中,因此会下载 amd64 或 arm64 软件包之一。

安装 Google Chrome

使用 apt 安装该软件包。此命令需要 sudo 权限:

sudo apt install 
"./google-chrome-stable_current_
$(
dpkg --print-architecture
)
.deb"

当提示时,输入你的密码并确认安装。

启动 Google Chrome

打开“活动”概览,搜索 “Google Chrome”,然后启动它:

你也可以从终端启动 Chrome:

google-chrome

Chrome 首次启动时,会询问你是否要将其设为默认浏览器并发送崩溃报告:

随后 Chrome 会打开欢迎页面:

在这里,你可以用 Google 账户登录并同步书签、历史记录、密码和扩展。

将 Chrome 设为默认浏览器

要从命令行将 Chrome 设为默认浏览器,运行:

xdg-settings 
set
 default-web-browser google-chrome.desktop

验证当前默认浏览器:

xdg-settings get default-web-browser
google-chrome.desktop

更新 Google Chrome

Chrome 软件包会把 Google 仓库添加到你的系统。用 cat 检查仓库文件:

cat /etc/apt/sources.list.d/google-chrome.sources
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# Changes to this file will not be preserved.
# This file will not be recreated if removed.
X-Repolib-Name: Google Chrome
Types: deb
URIs: https://dl.google.com/linux/chrome-stable/deb/
Suites: stable
Components: main
Architectures: amd64
Signed-By: /usr/share/keyrings/google-chrome.gpg

在 ARM 系统上,Architectures 字段显示 arm64 而非 amd64。

当前的 Chrome 软件包以 deb822 格式写入该文件,这就是为什么文件名以 .sources 而非 .list 结尾。较旧的 Chrome 版本使用 /etc/apt/sources.list.d/google-chrome.list,当软件包把你的系统迁移到新格式时会移除或注释掉该旧文件。Signed-By 行指向 Google 签名密钥,该密钥由软件包单独安装在 /usr/share/keyrings/google-chrome.gpg,这样即使 Chrome 被移除但未清除(purge)时,仓库仍能正常工作。

Chrome 的更新通过标准的 Ubuntu 更新流程安装:

sudo apt update

sudo apt upgrade

卸载 Google Chrome

要移除 Google Chrome 但保留已配置的 Google 仓库,运行:

sudo apt remove google-chrome-stable

移除不再需要的软件包:

sudo apt autoremove

这两条命令都不会动你位于 ~/.config/google-chrome 的浏览器配置文件,因此书签和设置会在重装后保留。

要连同仓库文件和签名密钥一起移除 Chrome,请改为清除该软件包:

sudo apt purge google-chrome-stable

sudo apt update

清除(purge)会删除 /etc/apt/sources.list.d/google-chrome.sources、/usr/share/keyrings/google-chrome.gpg 和 /etc/default/google-chrome,因此你的 APT 配置中不会留下任何与 Google 相关的内容。

故障排查

安装因依赖错误而失败——修复损坏的依赖关系并重复安装:

sudo apt --fix-broken install

sudo apt install 
"./google-chrome-stable_current_
$(
dpkg --print-architecture
)
.deb"

安装后 Chrome 无法启动——关闭任何正在运行的 Chrome 进程并重新启动它:

pkill -f google-chrome

google-chrome

仓库文件丢失且 Chrome 不再接收更新——仅重新安装软件包不会让文件回来。Chrome 通过在 /etc/default/google-chrome 中设置 repo_add_once="false" 来记录它已经配置过仓库,并且仅当该值为 true 时才会重新创建文件。把该值改回并重新安装:

sudo sed -i 
's/^repo_add_once=.*/repo_add_once="true"/'
 /etc/default/google-chrome

sudo apt install --reinstall 
"./google-chrome-stable_current_
$(
dpkg --print-architecture
)
.deb"

确认 /etc/apt/sources.list.d/google-chrome.sources 再次存在,然后运行 sudo apt update。

常见问题(FAQ)

Chrome 和 Chromium 有什么区别?Chromium 是 Chrome 所基于的开源浏览器项目。Chrome 增加了专有媒体编解码器、Google 账户集成,以及由 Google 管理的更新打包。

我可以在 Ubuntu 上安装 Chrome Beta 或 Dev 吗?可以。从 Google 下载 Beta 或 Dev 的 .deb 软件包,并用与稳定版软件包相同的方式通过 apt 安装。

Chrome 在 Ubuntu 上会自动更新吗?在添加 Google 仓库后,Chrome 由 Ubuntu 的软件包管理器更新。运行 sudo apt update && sudo apt upgrade 安装可用更新。

结论

Google Chrome 在 Ubuntu 26.04 上通过官方 .deb 软件包安装。安装后,Chrome 会随你的其他系统软件包一起从 Google 仓库接收更新。