Is Unrar Compatible with WSL?
Yes, unrar is fully compatible with the Windows
Subsystem for Linux (WSL). Because WSL runs an authentic Linux
environment directly on top of Windows, native Linux command-line
utilities—including archive managers like unrar—operate
without compatibility issues on both WSL 1 and WSL 2. This article
explains how to install unrar on your WSL distribution, how
to extract files, and how to access archives stored on your Windows
drives.
Why Unrar Works in WSL
WSL executes standard Linux ELF-64 binaries directly. When you invoke
a package manager inside WSL (such as apt on Ubuntu or
Debian), it downloads and installs the native Linux version of
unrar. The utility interacts with the underlying file
system just like it would on a standalone Linux machine, allowing you to
list, test, and extract RAR archives seamlessly.
How to Install Unrar in WSL
Installation depends on the Linux distribution configured inside your WSL setup. Most users run Ubuntu or Debian.
Ubuntu and Debian
- Open your WSL terminal.
- Update your local package index:
sudo apt update - Install the non-free, fully featured version of
unrar:(Note: If the package is not found, ensure thesudo apt install unrarmultiverserepository is enabled by runningsudo add-apt-repository multiverse && sudo apt update.)
Fedora
On Fedora-based WSL environments, enable RPM Fusion (free and
non-free) or install via dnf:
sudo dnf install unrarArch Linux
On Arch-based WSL environments, run:
sudo pacman -S unrarBasic Unrar Commands
Once installed, you can manage .rar files using standard
command-line flags:
- Extract with full directory paths:
unrar x archive.rar - Extract all files into the current directory (ignoring
folder structure):
unrar e archive.rar - List the contents of an archive without extracting:
unrar l archive.rar - Test archive integrity:
unrar t archive.rar
Working with Windows Files in WSL
WSL automatically mounts your local Windows drives under the
/mnt/ directory. If your RAR archive is saved on your
Windows desktop or download folder, you can navigate directly to it
within WSL to extract it:
cd /mnt/c/Users/YourUsername/Downloads
unrar x archive.rarAlternative Tools
If you prefer an open-source tool or encounter licensing restrictions
with the proprietary unrar package, several alternatives
work equally well in WSL:
- p7zip: Install
p7zip-fullviaaptand extract RAR files using7z x archive.rar. - unar: A command-line tool designed to handle RAR,
ZIP, and other archive formats with broad character encoding support.
Install it via
sudo apt install unarand rununar archive.rar.