user6487208
user6487208

Reputation:

How to update Chromedriver on Ubuntu?

I want to update Chromedriver to the latest version.

How can I do this on the command line?

Upvotes: 20

Views: 56117

Answers (9)

Viktor Ivliiev
Viktor Ivliiev

Reputation: 1334

I also had a problem with drivers, and the Chrome version did not match Ubuntu 24.04 today. A lot of places refer to old driver repositories, here are my steps:

  1. Comparison of the current version of driver and chrome:
chromedriver --version

=> ChromeDriver 128.0.6613.84 version hash

and

/usr/bin/google-chrome --version

=> Google Chrome 128.0.6613.119 (one we need to download)
  1. Updating the driver https://googlechromelabs.github.io/chrome-for-testing/#stable
wget https://storage.googleapis.com/chrome-for-testing-public/***YOUR_VERSION***/linux64/chromedriver-linux64.zip

unzip chromedriver-linux64.zip && cd chromedriver-linux64

sudo mv chromedriver /usr/bin/chromedriver && chmod +x /usr/bin/chromedriver

and then check the version

chromedriver --version   
                                                                     
-> ChromeDriver 128.0.6613.119 version hash

ps:// Archive-name may be different if you are using a different system

pss:// All versions when > 115 https://googlechromelabs.github.io/chrome-for-testing/

Upvotes: 0

Eran
Eran

Reputation: 537

Previous answers got the LATEST_RELEASE which is 114, however, that is not compatible with the current latest Chrome version 116. (both versions are correct to the time of the answer of course).

To download the right chromedriver version:

  1. Go to https://googlechromelabs.github.io/chrome-for-testing/ (got there from https://sites.google.com/chromium.org/driver/?pli=1)
  2. Choose the version according to your OS and Chrome version and copy that link. chromedrivers versions on googlechromelabs site
  3. install it (using the link you copied above)
wget -qP /tmp/ "<the-link-you-copied...>"
sudo unzip -oj /tmp/chromedriver_linux64.zip -d /usr/bin
sudo chmod 755 /usr/bin/chromedriver
  1. check it:
chromedriver --version

Upvotes: 3

Addison
Addison

Reputation: 8357

Download Chrome for Testing (Version 115 and later)

Google now releases "Chrome for Testing"

https://googlechromelabs.github.io/chrome-for-testing/#stable

If you need a new version, download it from here

Download Chromedriver (Version 114 and before)

This should download the old-school version of Chromedriver, and extract it to the correct location, with the correct permissions.

version=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE")
wget -qP /tmp/ "https://chromedriver.storage.googleapis.com/${version}/chromedriver_linux64.zip"
sudo unzip -o /tmp/chromedriver_linux64.zip -d /usr/bin

The permissions should be 755 by default, but if they aren't, you can run:

sudo chmod 755 /usr/bin/chromedriver

If you want a specific version, see the index page, or the website.
You can also edit the above commands to use LATEST_RELEASE_80, if you wanted version 80, for example.


Update to latest Chrome

If you don't already have the latest version of Google Chrome, you may need to update it with:

sudo apt-get --only-upgrade install google-chrome-stable

Upvotes: 63

mikm
mikm

Reputation: 160

After version 115, due to changes in the way ChromeDriver is released, the most accepted Addison's answer may no longer work. The currently working Eran's answer has been changed to automate the versioning process. This eliminates the need to visit the release page.

version=$(curl -s "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE")
echo "Installing ChromeDriver for version $version"
wget -N https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${version}/linux64/chromedriver-linux64.zip -O /tmp/chromedriver-linux64.zip
sudo unzip -oj /tmp/chromedriver-linux64.zip -d /usr/bin
sudo chmod 755 /usr/bin/chromedriver
chromedriver --version

Upvotes: 2

Du-Lacoste
Du-Lacoste

Reputation: 12767

Firstly check the Version of Chromium.

chromium-browser --version

Easiest way would be to download the Driver you need as per above chromium version then drop in /usr/share/bin directory in Linux.

https://chromedriver.chromium.org/downloads (to download Driver needed)

sudo mv -v <location_downloaded_driver>/chromedriver /usr/local/bin/.

To make sure Chrome Driver is properly working, you may check the version you just installed as below:

/usr/local/bin/chromedriver -v  #prints you the installed version

Upvotes: 0

dxvargas
dxvargas

Reputation: 815

I gave up using a downloaded independent Chromedriver. I'm using the Chromedriver that comes together with Chromium. This way they will always be in sync and (to answer the exact question) to update the chromedriver it's just necessary to update the Chromium version.

I've installed Chromium with snap:

snap install chromium

If I run:

snap info chromium

I see there are two commands, one for browser and the other for chromedriver:

commands:
 - chromium.chromedriver
 - chromium

All I have to do is run it, in my case I want to use port 4444:

chromium.chromedriver --port=4444

Upvotes: 0

Ben
Ben

Reputation: 1660

If you need this for chromium: Find your chromium Version here:

chromium-browser --version

Find the corresponding chromedriver Verion here: https://chromedriver.chromium.org/downloads

Then install as per MatzFans instructions.

Upvotes: 0

Kapil
Kapil

Reputation: 459

Download chromedriver from https://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip

Unzip it and put it in location /usr/bin/chromedriver and change its permission to 755 using chmod.

Upvotes: 7

MatzFan
MatzFan

Reputation: 937

$ wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip
$ unzip chromedriver_linux64.zip
$ sudo mv chromedriver /usr/bin/chromedriver
$ sudo chown root:root /usr/bin/chromedriver
$ sudo chmod +x /usr/bin/chromedriver

Upvotes: 14

Related Questions