(24年4月2日更新)Linux安装chrome及chromedriver(Ubuntu20.04&16.04)

一、安装Chrome

1)先执行命令下载chrome:

bash 复制代码
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

2)安装chrome

bash 复制代码
sudo dpkg -i google-chrome-stable_current_amd64.deb

踩坑:这里会提示如下报错:

(Reading database ... 29779 files and directories currently installed.)

Preparing to unpack google-chrome-stable_current_amd64.deb ...

Unpacking google-chrome-stable (123.0.6312.86-1) over (104.0.5112.101-1) ...

dpkg: dependency problems prevent configuration of google-chrome-stable:

google-chrome-stable depends on fonts-liberation; however:

Package fonts-liberation is not installed.

google-chrome-stable depends on libatk-bridge2.0-0 (>= 2.5.3); however:

Package libatk-bridge2.0-0 is not installed.

google-chrome-stable depends on libatk1.0-0 (>= 2.2.0); however:

Package libatk1.0-0 is not installed.

google-chrome-stable depends on libatspi2.0-0 (>= 2.9.90); however:

Package libatspi2.0-0 is not installed.

google-chrome-stable depends on libcairo2 (>= 1.6.0); however:

Package libcairo2 is not installed.

google-chrome-stable depends on libcups2 (>= 1.6.0); however:

Package libcups2 is not installed.

google-chrome-stable depends on libdrm2 (>= 2.4.75); however:

Package libdrm2 is not installed.

google-chrome-stable depends on libgbm1 (>= 17.1.0~rc2); however:

Package libgbm1 is not installed.

google-chrome-stable depends on libgtk-3-0 (>= 3.9.10) | libgtk-4-1; however:

Package libgtk-3-0 is not installed.

Package libgtk-4-1 is not installed.

google-chrome-stable depends on libnspr4 (>= 2:4.9-2~); however:

Package libnspr4 is not installed.

google-chrome-stable depends on libnss3 (>= 2:3.35); however:

Package libnss3 is not installed.

google-chrome-stable depends on libpango-1.0-0 (>= 1.14.0); however:

Package libpango-1.0-0 is not installed.

google-chrome-stable depends on libu2f-udev; however:

Package libu2f-udev is not installed.

google-chrome-stable depends on libvulkan1; however:

Package libvulkan1 is not installed.

google-chrome-stable depends on libxcomposite1 (>= 1:0.4.4-1); however:

Package libxcomposite1 is not installed.

google-chrome-stable depends on libxdamage1 (>= 1:1.1); however:

Package libxdamage1 is not installed.

google-chrome-stable depends on libxfixes3; however:

Package libxfixes3 is not installed.

google-chrome-stable depends on libxkbcommon0 (>= 0.5.0); however:

Package libxkbcommon0 is not installed.

google-chrome-stable depends on libxrandr2; however:

Package libxrandr2 is not installed.

google-chrome-stable depends on xdg-utils (>= 1.0.2); however:

Package xdg-utils is not installed.

dpkg: error processing package google-chrome-stable (--install):

dependency problems - leaving unconfigured

Processing triggers for mime-support (3.64ubuntu1) ...

Errors were encountered while processing:

google-chrome-stable
只需要执行以下命令,即可以解决报错

bash 复制代码
apt --fix-broken install ./google-chrome-stable_current_amd64.deb

3)查看安装的chrome版本:

bash 复制代码
google-chrome --version

如果安装成功,命令行结果会显示:Google Chrome 123.0.6312.86

二、安装Chromedriver

你可以访问 https://googlechromelabs.github.io/chrome-for-testing/#stable 这个地址去下载更新的chromedriver:

键入以下命令:

bash 复制代码
wget https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/linux64/chrome-linux64.zip

然后到目录中执行:

bash 复制代码
unzip chromedriver-linux64.zip
cd chromedriver-linux64
mv chromedriver /usr/bin

这样我们就完成了chrome和chromedriver的安装了

三、(选看部分)Ubuntu16.04安装

参考这篇csdn博客:https://blog.csdn.net/qq_35831906/article/details/133215731

相关推荐
凯子坚持 c15 小时前
从零开始:开发一个仓颉三方库的完整实战
大数据·elasticsearch·搜索引擎
人大博士的交易之路15 小时前
今日行情明日机会——20251104
大数据·数据挖掘·数据分析·缠论·涨停回马枪·道琼斯结构
John Song16 小时前
用zookpeer搭建Hadoop的HA集群,组件启动的启动顺序是什么?
大数据·hadoop·debian
赖small强16 小时前
【蓝牙】BLE 数据收发实战指南(手机 App ↔ 嵌入式 Linux/BlueZ)
linux·蓝牙·bluez·bluetoothctl·dbus-monitor·central·peripheral
wit_yuan16 小时前
linux udp广播数据包实际用例
linux·服务器·udp
大聪明-PLUS16 小时前
io_uring:Linux 上的高性能异步 I/O
linux·嵌入式·arm·smarc
Hello.Reader16 小时前
Flink Table API & SQL 概念、常用 API 与工程落地
大数据·sql·flink
qq_4798754316 小时前
Linux time function in C/C++【2】
linux·c语言·c++
小武~16 小时前
嵌入式网络编程深度优化 --网络协议栈配置实战指南
linux·网络·网络协议
二进制星轨16 小时前
在 Ubuntu 上快速配置 Node.js 环境(附问题说明)
linux·ubuntu·node.js