(24年4月2日更新)Linux安装chrome及chromedriver(Ubuntu20.04&16.04)
创始人
2024-11-06 01:08:48
0

一、安装Chrome

1)先执行命令下载chrome:

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

2)安装chrome

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

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

apt --fix-broken install ./google-chrome-stable_current_amd64.deb 

3)查看安装的chrome版本:

google-chrome --version 

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

二、安装Chromedriver

你可以访问 https://googlechromelabs.github.io/chrome-for-testing/ 这个地址去下载更新的chromedriver:
在这里插入图片描述
键入以下命令:

wget https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/linux64/chrome-linux64.zip 

然后到目录中执行:

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

相关内容

热门资讯

透视辅助!微信微乐小程序辅助器... 透视辅助!微信微乐小程序辅助器免费安装(辅助挂)好像存在有挂(详细辅助介绍教程);1、实时微信微乐小...
透视辅助!广西友乐免费辅助(辅... 透视辅助!广西友乐免费辅助(辅助挂)一贯真的是有挂(详细辅助必赢方法)1、广西友乐免费辅助透视辅助简...
透视辅助!好玩贰柒拾辅助(辅助... 透视辅助!好玩贰柒拾辅助(辅助挂)原来真的是有挂(详细辅助揭秘教程)1、好玩贰柒拾辅助ai辅助优化,...
透视辅助!丫丫陕西插件(辅助挂... 透视辅助!丫丫陕西插件(辅助挂)其实真的是有挂(详细辅助透视教程);1、每一步都需要思考,不同水平的...
透视辅助!途游游戏辅助脚本(辅... 透视辅助!途游游戏辅助脚本(辅助挂)都是存在有挂(详细辅助2025版教程);透视辅助!途游游戏辅助脚...
透视辅助!微信小程序蜀山四川血... 透视辅助!微信小程序蜀山四川血战辅助(辅助挂)本来真的有挂(详细辅助2025新版)1、下载好微信小程...
透视辅助!微信多乐跑得快辅助工... 透视辅助!微信多乐跑得快辅助工具(辅助挂)本来是真的有挂(详细辅助辅助教程)1、很好的工具软件,可以...
透视美元局!智星德州菠萝插件官... 透视美元局!智星德州菠萝插件官网,aapoker辅助挂,规律教程(有挂工具);智星德州菠萝插件官网辅...
透视辅助!闲聚辅助器(辅助挂)... 透视辅助!闲聚辅助器(辅助挂)果然是真的有挂(详细辅助技巧教程)所有人都在同一条线上,像星星一样排成...
透视黑科技!德普之星透视辅助软... 透视黑科技!德普之星透视辅助软件下载,aapoker脚本怎么用,黑科技教程(有挂细节)1、点击下载安...