As per Microsoft’s WSL install guide:
Go into
Windows Features, turn onWindows Subsystem for Linuxand then restart computer
wsl --installwsl -l --onlinewsl --updatewsl --install
    wsl --install -d Ubuntukumar-wsl) and passwordsudo apt update && sudo apt upgrade -yNote the different Windows native and WSL home folders
| Terminal | Windows native home | WSL home | 
|---|---|---|
| PowerShell | ~orC:\Users\kumar | \\wsl$\Ubuntu\home\kumar-wsl | 
| Git-Bash | ~or/c/Users/kumar | /\\wsl.localhost/Ubuntu/home/kumar-wsl | 
| WSL | /mnt/c/Users/kumar | ~or/home/kumar-wsl | 
Edit the .bashrc and paste config contents such as my .bashrc file
Install packages: fastfetch, build-essential
sudo add-apt-repository ppa:zhangsongcui3371/fastfetch
sudo apt update
sudo apt install wget curl git tmux zip unzip build-essential net-tools fzf jq bat ripgrep eza bat htop fastfetch hwinfo
# zoxide install script
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
The build-essential contains a list of packages dependencies that are required to create a Debian package (.deb) . These packages are libc, gcc, g++, make, dpkg-dev etc.
The bat package is installed under name batcat in Ubuntu due to name clash. So creat symlink as below:
mkdir -p ~/.local/bin
ln -s /usr/bin/batcat ~/.local/bin/bat
Type exit to close WSL Ubuntu session
See output of lsblk to know your distro is mounted at /mnt/wslg/distro. Your usual local Windows files in C drive are available at /mnt/c
Install:
winget install -e --id Alacritty.Alacritty
On Windows, the config file will be looked for in: %APPDATA%\alacritty\alacritty.toml. To know value of that variable, open CMD and run echo %APPDATA%. You will see output as C:\Users\kumar\AppData\Roaming
So, create config file AppData/Roaming/alacritty/alacritty.toml via Git-Bash as:
mkdir -p ~/AppData/Roaming/alacritty
touch ~/AppData/Roaming/alacritty/alacritty.toml
wsl