How to Install and Run Bash on Windows 11
Windows 11 already provides a ton of functionality right out of the box, but sometimes you need to use Linux command-line tools in Windows. Enter Bash, the popular shell for Linux and macOS.
Fortunately, it’s easy to run Bash on Windows 11 using a supported tool called Windows Subsystem for Linux (WSL). Here’s what you need to know to use Bash on Windows 11.
Step 1: Enable WSL
By default, Windows 11 doesn’t have WSL enabled, so you’ll need to turn it on manually.
To do that, first open the Start menu, search for PowerShell, and then right-click on Windows PowerShell and select “Run as administrator.”
In the PowerShell window, enter the following command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Press Enter and wait while Windows 11 enables the feature. You’ll need to restart your computer when prompted.
Step 2: Install a Linux distribution
Once you’ve enabled WSL, you need to install a Linux distribution. Microsoft has an official version of Ubuntu available in the Microsoft Store, but you can also install other distros like Debian, Fedora, and openSUSE.
To download and install Ubuntu, open the Microsoft Store and search for “Ubuntu.” Click the “Get” button to download and install the application.
Step 3: Launch Bash
Once you’ve installed Ubuntu (or another WSL-supported distro), it’s time to launch Bash. You can do this either by launching the app from the Start menu or by selecting it from the Microsoft Store.
Once you launch Bash, you should see a terminal window open with a Bash prompt. Congratulations, you’ve successfully installed and launched Bash on Windows 11!
Step 4: Update the package list
Now that you have Bash up and running, you’ll probably want to start installing Linux packages. The first thing you’ll need to do is update the package list.
To do that, enter the following command:
sudo apt update
You’ll be prompted for your Ubuntu password (which you set during installation), and then the package list will update. This process may take a few minutes.
Step 5: Install packages
Now that you have an updated package list, you can start installing packages.
To install a package, enter the following command:
sudo apt-get install package-name
Replace “package-name” with the name of the package you want to install. For example, to install the “curl” package, you would enter:
sudo apt-get install curl
Step 6: Enjoy Bash on Windows 11!
Congratulations, you’ve successfully installed and used Bash on Windows 11! With Bash, you’ll have access to a wide range of Linux command-line tools, making it easier to work with Linux-based applications and systems.
With these simple steps, you can run powerful command-line tools on Windows 11 with ease. Enjoy!