怎样在Ubuntu上安装Google Chrome浏览器

2022年12月3日 | 分类: 【软件】

【源起】

相对于系统自带的 FireFox ,Google Chrome 的优势在:
1. 键盘能输入(嗯,的确是个优势)
2. 自带 Google Translate ,这样看小语种网站不再乱猜
3. 同样有 Image Block 插件

【安装:下载软件包方式】

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install fonts-liberation xdg-utils -y
sudo dpkg -i google-chrome-stable_current_amd64.deb

卸载程序:

sudo apt purge google-chrome-stable

完全卸载程序相关数据:

sudo rm -rf ~/.config/google-chrome

参考:https://zhuanlan.zhihu.com/p/483039943

启动方式1:终端

在终端命令行输入:

google-chrome --no-sandbox

回车后,终端界面开始加载,然后启动 Google Chrome 软件界面。

启动方式2:Ubuntu桌面快捷按钮

点击右键,出现菜单,点击第一个“Create Launcher”,
输入:
Name:Google Chrome
Command:google-chrome –no-sandbox
Icon:选择 G 图标。
然后点击“Create”
然后Ubuntu桌面上出现了快捷按钮

点击按钮,立刻进入 Google Chrome 软件界面,没有终端界面。

为什么要在启动命令中加入 –no-sandbox ?

参考:https://qastack.cn/unix/68832/what-does-the-chromium-option-no-sandbox-mean

Google自己建议使用其他浏览器,而不要使用不带沙箱的Chrome。

【安装:添加源方式】

参考:https://blog.csdn.net/zhoujinshi/article/details/119932508

添加资源:

sudo echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ \
stable main" > /etc/apt/sources.list.d/google-chrome.list

添加谷歌证书:

sudo wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | \
sudo apt-key add -

更新源:

sudo apt-get update

安装:

sudo apt-get install google-chrome-stable

【扩展】

扩展商店:https://chrome.google.com/webstore/category/extensions

网页翻译:Google Translate

网址:https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb

屏蔽图片:Image Block

网址:https://chrome.google.com/webstore/detail/block-image/pehaalcefcjfccdpbckoablngfkfgfgj

1. 直接打开Chrome商店,搜索目标并安装扩展

【排错】

问题:无法访问 Chrome商店,怎么安装扩展?

Chrome的扩展程序也有其“安装包”,即crx文件安装扩展。 通过crx文件压缩包安装扩展程序。

需要开启让Chrome支持crx文件:
1. 在Chrome的地址栏中,输入:chrome://extensions/ 回车,进入到Chrome管理扩展程序的界面。
2. 界面中,可以看到一个“开发者模式”的按钮,开启即可。
3. 可以在Chrome中看到“加载已解压的扩展程序”这个按钮,这就是Chrome通过crx文件安装扩展程序的途径。

A. 把下载到的extension_*_*_*.crx拖拽到扩展程序界面,这时会提示安装。
B. Chrome并不能直接加载crx文件(直接拖拽?)。我们首先需要修改crx文件的后缀名,将其改为“.zip”,之后解压到一个文件夹中。
点击“加载已解压的扩展程序”按钮后,进入到这个扩展程序解压后的目录,然后点击“选择文件夹”,这个扩展程序就安装上了。

扩展资源:

网址:https://chrome.zzzmh.cn
网址:https://www.gugeapps.net
网址:https://www.crx4chrome.com/

【排错】

问题:中文显示为小方块

参考:https://amon.org/ubuntu-zh

问题:更改主机名,重启电脑打不开谷歌浏览器

参考:https://blog.csdn.net/u010420283/article/details/103288583

重启电脑点击打开google chrome会出现一个小框,显示如下内容:

The profile appears to be in use by another Google Chrome process (8879) on another computer (“previous name of the computer”). Chrome has locked the profile so that it doesn’t get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chrome.

终端敲入命令:

rm -rf ~/.config/google-chrome/Singleton*