How to Install UNRAR on Debian Linux

Unrar extracts RAR archive files on Debian. Whether you are unpacking downloaded software, restoring backup archives, or working with compressed media collections, you need a dependable tool that handles current RAR formats. The proprietary implementation from RARLAB supports modern RAR4 and RAR5 archives (including encrypted and multi-part sets), while the unrar-free package only handles legacy RAR1-RAR3 files.

This guide shows how to install both implementations, explains their differences, provides a quick capability comparison, and covers practical extraction examples (basic, password-protected, integrity testing, and multi-part archives). It also clarifies common pitfalls so you can choose the right package for long-term use.

Choose Your RAR Extraction Implementation

Debian ships two RAR extraction packages. RARLAB’s non-free version supports current archive formats; unrar-free is open-source but limited to older RAR generations. If you need broad format and encryption support, choose RARLAB’s version. Only select unrar-free for strict licensing environments where you exclusively process legacy archives.

ImplementationPackageBinary / CommandSupported RAR VersionsLicensePrimary Use CaseLimitations
RARLAB Unrar (Recommended)unrar (non-free)unrarRAR1-RAR5 (full support incl. encryption & multi-part)Freeware (proprietary)Modern archives from current WinRAR and cross-platform sourcesNot open-source; packaged in non-free component; extraction only
unrar-freeunrar-freeunrar-freeRAR1-RAR3 onlyGPL (open-source)Auditable extraction of legacy RAR archivesNo RAR4/RAR5, no modern encryption, limited feature set
Optional: Unarchiver (broader formats)unarunar / lsarRAR (legacy; partial newer support) + many other formatsMixed upstream licensingMulti-format extraction beyond RAR (ZIP, 7z, CAB, StuffIt, etc.)Different syntax; unnecessary if you only handle RAR

The unar package is separate and provides the unar and lsar commands. It is not installed when you install unrar-free. Earlier references that equated unrar-free with the unar command are incorrect.

RARLAB’s Unrar (Recommended)

RARLAB’s proprietary version handles modern RAR4 and RAR5 formats created by recent WinRAR versions. It receives upstream updates promptly for security and compatibility, supports password-protected and encrypted archives, and works reliably across UNIX-like systems and Windows. It only extracts (it cannot create RAR archives); to create RAR files you would need the separate rar package or use alternative formats like 7z or tar.xz.

unrar-free (Open-Source Alternative)

The open-source unrar-free package provides auditable source code. It cannot decode newer compression/encryption features found in RAR4/RAR5 archives (proprietary algorithm constraints), so it is limited to legacy RAR1-RAR3 files. It is suitable only if your workflows never involve modern archives and compliance demands a fully open-source tool.

Choose RARLAB’s implementation for any general-purpose desktop, server, or mixed-platform environment. Use unrar-free only for narrowly scoped, legacy archive processing where modern formats will never appear.

Update Debian Before Installation

Update your package index and apply pending upgrades first. This reduces dependency resolution issues and ensures the newest archive metadata for non-free components.

Run the following command to update your system:

sudo apt update && sudo apt upgrade

This command refreshes package metadata and installs available updates for currently installed packages.

Install Your Preferred RAR Extraction Package

Option 1: Install RARLAB’s Unrar (Recommended)

RARLAB’s version resides in Debian’s non-free component. Ensure contrib and non-free (and on Debian 12+ optionally non-free-firmware) are enabled before installing. Refer to the repository configuration guide if these components are absent.

Step 1: Enable the Required Repositories

Debian 12 (Bookworm) and newer, including Debian 13 (Trixie), use the modern sources management workflow. First, ensure the helper for repository management is installed:

sudo apt install software-properties-common -y

Next, make sure the contrib and non-free components are enabled (and non-free-firmware on Debian 12/13). Use your existing repo format: if you already run DEB822 on 12/13, confirm those components are present; otherwise follow the linked guide for the exact snippets.

On Debian 11 (legacy sources.list format), add the components with:

sudo add-apt-repository contrib non-free

Debian 13 (Trixie) is current stable and Debian 12 (Bookworm) is oldstable; both use the modern DEB822 format. Debian 11 (Bullseye) is oldoldstable under LTS and keeps the legacy repository format. If you are on Debian 11, use the command above (no non-free-firmware). Avoid mixing DEB822 files with add-apt-repository-generated entries in sources.list.

For detailed guidance on enabling these repositories, refer to the guide on enabling Contrib and Non-Free repositories on Debian.

Step 2: Update the Repository List

After enabling components, update your package list:

sudo apt update

Step 3: Install RARLAB’s Unrar

Install RARLAB’s Unrar (non-free):

sudo apt install unrar

Verify installation (binary name is unrar):

unrar --version

Example output confirming successful installation (version may differ):

UNRAR 6.24 freeware      Copyright (c) 1993-2023 Alexander Roshal

This version supports RAR4 and RAR5 (plus legacy formats), encrypted archives, and multi-part sets. It cannot create new RAR archives.

Option 2: Install Open-Source unrar-free

The unrar-free package does not support RAR4 or RAR5 formats. Commands and functionality also differ from the proprietary version. Only choose this option if you work exclusively with older RAR files and require open-source tools.

Install the open-source alternative:

sudo apt install unrar-free

Verify installation:

unrar-free --version

Example output:

unrar-free 0.1.3 Copyright (c) GNU GPL.
Limited to legacy RAR1-RAR3 extraction.

Important: The binary name is unrar-free. The separate unar/lsar tools come from the unar package, which is not installed by unrar-free.

Extract RAR Files

After installing your chosen package, use these examples for common tasks (listing, full extraction with path preservation, flat extraction, password prompts, integrity testing, and multi-part handling). For other archive formats see guides on extracting .gz and .tgz files, unzipping directories, or installing 7-Zip on Debian.

Extraction with RARLAB’s Unrar

Extract a RAR archive with full directory paths preserved (current directory destination):

unrar x archive.rar

The x command preserves the directory structure. Use e to extract files into the current directory without recreating subdirectories:

unrar e archive.rar

Extract to a specific destination directory:

unrar x archive.rar /path/to/destination/

List archive contents without extracting:

unrar l archive.rar

Extract a password-protected archive (tool prompts interactively for password):

unrar x protected-archive.rar

Optional inline password (avoid if shell history retention is a concern):

unrar x -pYOURPASSWORD protected-archive.rar

Test archive integrity (no extraction):

unrar t archive.rar

Extract a multi-part set (specify only the first volume, e.g. archive.part01.rar or archive.rar when accompanied by archive.r00, archive.r01, etc.):

unrar x archive.part01.rar

Extraction with unrar-free

If you installed unrar-free, use its binary directly (limited to legacy formats):

unrar-free archive.rar

Extract to a specific destination by first creating and changing to the target directory (unrar-free focuses on simple extraction):

mkdir -p /path/to/destination && cd /path/to/destination && unrar-free /path/to/archive.rar

Treat unknown RAR archives cautiously. Scan suspicious content with a malware scanner (for example, ClamAV: sudo apt install clamav then clamscan -r extracted_directory). Avoid embedding plain passwords in shell history when using inline flags.

Troubleshooting

Choosing Between Installed Versions

If you installed both packages, each uses a different binary name: RARLAB’s package installs unrar, and unrar-free installs unrar-free. There is no direct file conflict, but keeping both is redundant. Remove the one you do not need:

sudo apt remove unrar-free

Or remove the proprietary version if you only need legacy extraction:

sudo apt remove unrar

Password-Protected Archives Not Extracting

If an archive fails with a password error, confirm you are using RARLAB’s Unrar; unrar-free lacks modern encryption support. Re-enter the password carefully (interactive prompt does not re-prompt on failure). For RAR5 archives ensure your Unrar version is up to date; upgrade if necessary.

“Unsupported RAR Format” Error

If unrar-free returns “unsupported format,” the archive uses RAR4 or RAR5 features. Switch to RARLAB’s implementation:

sudo apt remove unrar-free && sudo apt install unrar

Conclusion

RARLAB’s Unrar (non-free) reliably handles RAR4/RAR5 archives, encryption, and multi-part sets, making it the default choice for nearly all Debian users. unrar-free remains valuable only for legacy, compliance-focused workflows. With the correct package installed, you can list, test, and extract RAR archives confidently while applying safe practices for passwords and suspicious content.

1 thought on “How to Install UNRAR on Debian Linux”

  1. (py) 16:18:41al@alsdesk:~$ sudo apt install unrar
    Package unrar is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Error: Package ‘unrar’ has no installation candidate
    (py) 16:18:57al@alsdesk:~$ sudo apt install unrar-free
    Package unrar-free is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Error: Package ‘unrar-free’ has no installation candidate
    (py) 16:19:06al@alsdesk:~$

    Reply

Leave a Comment