20

I want to update Chromedriver to the latest version.

How can I do this on the command line?

Addison
  • 7,322
  • 2
  • 39
  • 55

7 Answers7

62

Download Chromedriver

This should download the latest 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
Addison
  • 7,322
  • 2
  • 39
  • 55
  • 1
    Then use this to update Chrome: `sudo apt-get --only-upgrade install google-chrome-stable` – alchemy Apr 14 '20 at 23:02
  • 2
    This HAS to be the accepted answer.. the fact that you don't have to hunt chromium webpages to get the link or version number, and not having to download and unzip and move stuff manually is very nice. – P S Solanki Aug 07 '21 at 09:44
  • This does not give you the latest version on Ubuntu 20, I got 93.0 something where as the latest is 95 today. – mLstudent33 Sep 26 '21 at 00:11
  • I guess Google forgot to update the `LATEST_RELEASE` file. If you want a specific version, I also included instructions for that. They'll probably fix their problem in a week or two. – Addison Sep 26 '21 at 23:51
  • `E: Unable to locate package google-chrome-stable` – alper Apr 08 '22 at 19:17
12
$ 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
MatzFan
  • 877
  • 8
  • 17
7

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.

Kapil
  • 459
  • 3
  • 14
0

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.

Ben
  • 1,631
  • 13
  • 15
0

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

dxvargas
  • 811
  • 14
  • 23
0

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
Du-Lacoste
  • 11,530
  • 2
  • 71
  • 51
0

Previous answers got the LATEST_RELEASE that is 114, however that is not compatible with the current latest chrome version 116. (both versions 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
Eran
  • 423
  • 4
  • 12