Skip to content

Instantly share code, notes, and snippets.

@drexler
Created May 24, 2018 16:03
Show Gist options
  • Save drexler/d70ab957f964dbef1153d46bd853c775 to your computer and use it in GitHub Desktop.
Save drexler/d70ab957f964dbef1153d46bd853c775 to your computer and use it in GitHub Desktop.
Install Chrome under WSL
# assumes you have ubuntu-desktop installed which includes stock libpulse
sudo add-apt-repository ppa:therealkenc/wsl-pulseaudio
sudo apt-get update && sudo apt-get upgrade
# Download the stable or development Chrome .deb package - dev if you want headless functionality
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt -f install # probably
wget https://github.com/therealkenc/libudev-stub/releases/download/v0.9.0/libudev-stub-0.9.0-WSL.deb
sudo dpkg -i libudev-stub-0.9.0-WSL.deb # doing this **last** is important
@jo-quin
Copy link

jo-quin commented Aug 27, 2019

@drexler Don't worry! It is quite challenging to work with WSL. I ended up not using WSL for my project.

@lackovic
Copy link

lackovic commented Jan 7, 2020

I am still happily using WSL and looking forward for WSL 2 to be completed!

Here is a couple of Chrome related links which were helpful to me:

@GuyGoldenberg
Copy link

GuyGoldenberg commented May 15, 2020

I keep getting this error

apt: /lib/x86_64-linux-gnu/libudev.so.1: no version information available (required by /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0)
UDEV STUB: Using libudev-stub 0.9.0

whenever I try to install any package. I've not been able to install any package since.
Any suggestions?

It seems like this script can brake the symlink which is used by apt to load the libudev.so.
To fix this locate the real libudev.so on your machine (ls -l /lib/x86_64-linux-gnu/libudev.so.*).
On my machine it's /lib/x86_64-linux-gnu/libudev.so.1.6.9.

Then, override the symlink by running

sudo ln -s /lib/x86_64-linux-gnu/libudev.so.{YOUR_VERSION} /lib/x86_64-linux-gnu/libudev.so.1

@ZhigangPu
Copy link

I keep getting this error

apt: /lib/x86_64-linux-gnu/libudev.so.1: no version information available (required by /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0)
UDEV STUB: Using libudev-stub 0.9.0

whenever I try to install any package. I've not been able to install any package since.
Any suggestions?

It seems like this script can brake the symlink which is used by apt to load the libudev.so.
To fix this locate the real libudev.so on your machine (ls -l /lib/x86_64-linux-gnu/libudev.so.*).
On my machine it's /lib/x86_64-linux-gnu/libudev.so.1.6.9.

Then, override the symlink by running

sudo ln -s /lib/x86_64-linux-gnu/libudev.so.{YOUR_VERSION} /lib/x86_64-linux-gnu/libudev.so.1

exactly this

@kev26
Copy link

kev26 commented Oct 8, 2020

I am still happily using WSL and looking forward for WSL 2 to be completed!

Here is a couple of Chrome related links which were helpful to me:

You had saved my life <3

@jenipharachel
Copy link

@kev26 @lackovic Is it possible to use chrome without the chromedriver in WSL, since chromedrivers are said to be installed for WSL2, whereas I'm using WSL1

@lackovic
Copy link

lackovic commented Dec 2, 2020

@kev26 @lackovic Is it possible to use chrome without the chromedriver in WSL, since chromedrivers are said to be installed for WSL2, whereas I'm using WSL1

Sorry, I don't know about WSL1: the best thing you can do is to migrate to WSL2, it is so much better it is really not worth to stay on WSL1.

@veena-LINE
Copy link

veena-LINE commented Dec 6, 2020

If it helps anyone,
instead of installing chrome exclusively for WSL (mine's WSL1), here's what worked for me with whatever was installed on Windows:
Since ~/.bashrc references .bash_aliases, use any editor. I'm using nano here:

$ nano ~/.bash_aliases
alias chrome="powershell.exe -Command start chrome"
alias firefox="powershell.exe -Command start firefox"

Without re-starting Bash, just type:

$source ~/.bashrc

Test with alias name:

$chrome

@RayendraSabandar
Copy link

I am still happily using WSL and looking forward for WSL 2 to be completed!

Here is a couple of Chrome related links which were helpful to me:

Thank you very very much. Works perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment