DEV Community

Yuki Kimoto
Yuki Kimoto

Posted on

Installation of Perl on WSL 2 2022

WSL 2 is Windows Subsystem for Linux. You can install Linux on Windows using WSL 2. And you can use Perl.

Installation of WSL 2

Let's intall WSL 2. Run the following command on Windows Command Prompt.

# Install WSL 2
wsl --install
[Ubuntu](https://en.ubuntu.perlzemi.com/) is installed by default. Reboot Windows to enable WSL2. Take a few minutes. You see the following messages. #### User Name
Installing, this may take a few minutes...

Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username:

I enter the following user name as an example.

kimoto_ubuntu

By right-clicking on Ubuntu terminal, you can paste the user name.

Password

Next, set password.

The setup of Ubuntu is completed.

Boot Ubuntu

Let's boot Ubuntu.

"Start Menu" | "Ubuntu"

Checking the installation of Perl

Perl is installed by default on Ubuntu. Let's check the installation of Perl.

perl -v

The version of Perl is displayed.

This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi

Show files using Explore

You can see files on Ubuntu by the following path. \wsl$ is root directory of WSL 2.

\\wsl$\Ubuntu\home\kimoto_ubuntu

Discussion (0)