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

  1. Open your WSL terminal.
  2. Update your local package index:
    sudo apt update
  3. Install the non-free, fully featured version of unrar:
    sudo apt install unrar
    (Note: If the package is not found, ensure the multiverse repository is enabled by running sudo 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 unrar

Arch Linux

On Arch-based WSL environments, run:

sudo pacman -S unrar

Basic 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.rar

Alternative 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-full via apt and extract RAR files using 7z 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 unar and run unar archive.rar.