The new version (May 2019 update) of Windows 10 contains a new updated feature called Windows Subsystem for Linux (WSL) using which you can run Linux applications natively in Windows. It provides a native Linux kernel to be run directly inside Windows. You can also install different Linux distros such as Ubuntu, Kali, Alpine, Debian, OpenSUSE etc., depending on your requirements. We have previously posted about how to install Linux bash shell in Windows 10.
If you want to install a software in the WSL Linux for Windows 10, then you can easily do it using the respective package deployment tools. For example, in case of Debian and Debian based Linux distros you can use apt to install new software and update already installed software.
In the following steps, we will show you how to install gcc (GNU Compiler Collection) in Debian Linux running under WSL in Windows 10:
- Launch bash shell. For this, you can press Win+R, type bash.exe and press Enter.
- Type sudo apt update and press Enter. This will download the latest package list from the internet. You will have to supply your Linux user password in order to continue.
- Once the package list is downloaded and updated, you can continue to install new software. We want to install gcc, so we give command sudo apt-get install gcc. It will seek your permission before continuing, downloading and installing the selected packages.
- Once installation is complete, you can try running the newly installed packages. In my case, I checked the version of gcc installed using the command gcc –version. Turns out Debian is using gcc version 6.3 which is a relatively safe version.
This way you can install basically any software in Linux shell running under WSL in Windows 10. However, since this is not full Linux and only a shell, you cannot install software that need access to the display (graphical user interface software). For example, a popular Linux text editor Geany gets installed under WSL but fails to run.