Skip to content

Instantly share code, notes, and snippets.

@amineHorseman
Last active January 25, 2025 15:05
Show Gist options
  • Save amineHorseman/161fadea328cdd4f27af8a20ec449f66 to your computer and use it in GitHub Desktop.
Save amineHorseman/161fadea328cdd4f27af8a20ec449f66 to your computer and use it in GitHub Desktop.
Install Chrome, Firefow, and Edge on WSL (Windows Subsystem for Linux)
# This gist will show you how to install your favourite browsers on WSL (Windows Subsystem for Linux)
# We will install:
## 1. Google Chrome
## 2. Mozilla Firefox
## 3. Microsoft Edge
# Please leave a star on the gist to enhance its visibility
######## [optional] Before we start ########
# WSL2 includes built-in support for running GUI applications through WSLg, but in case you have
# issues running GUI, you can download and install VcXsrv (X11 server) from the official website.
######## 1. Install Google Chrome ########
# Run the following command in WSL terminal:
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
# If you get an error use the following commands:
sudo apt install --fix-broken -y`
sudo dpkg -i google-chrome-stable_current_amd64.deb
# Now the browser is installed, you can run it using:
google-chrome-stable
# [optional] Create an alias for easier access using the "chrome" command:
echo alias chrome="google-chrome-stable" >> ~/.bashrc
chrome
######## 2. Install Mozilla Firefox ########
# Run the following command in WSL terminal:
sudo apt update
sudo apt install snapd
sudo apt install firefox
# Now the browser is installed, you can run it using:
firefox
######## 3. Install Microsoft Edge ########
# Run the following command in WSL terminal:
sudo apt install curl gpg software-properties-common apt-transport-https
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main"
# Press [Enter] key when prompted, then run the following commands:
sudo apt update
sudo apt install microsoft-edge-stable
# Now the browser is installed, you can run it using:
microsoft-edge-stable
# [optional] Create an alias for easier access using the "edge" command:
echo alias edge="microsoft-edge-stable" >> ~/.bashrc
edge
######## Quick access ########
# You can also run these browsers directly from the Windows Start menu, they are
# automatically inserted in a folder with the same name as your WSL distibution.
######## Don't hesitate to propose enhancements or corrections if needed.
######## You can also hit the star button to help others discover this gist easily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment