How to Extract RAR Files in Ubuntu?

Learn how to extract regular, multi-part, and password-protected RAR files on Ubuntu VPS using command-line and graphical tools.
8 min read
Intermediate
Extract RAR Files in Ubuntu

To extract RAR files on Ubuntu, you need an archive utility that supports the RAR format because Ubuntu doesn’t support RAR format by default, first you should install the UnRAR package on your Ubuntu VPS to be able to extract the files.

In this guide, you’ll learn how to install UnRAR on Ubuntu, whether you’re using a VPS or a local machine, extract RAR files to different directories, and open archives using Ubuntu’s graphical interface.

If you don’t have an Ubuntu server running on a VPS, you can get one from VPSMakers and follow this guide on your own Ubuntu VPS:

Note:

The instructions in this guide have been tested by the VPSMakers technical team on Ubuntu 24.04 LTS (VPS) and Ubuntu 26.04 LTS (Desktop). They are also applicable to other Ubuntu versions, although some commands or package availability may vary.

Install UnRAR on Ubuntu

First, you need to install UnRAR on Ubuntu to work with RAR files. Before installing it, update your package list to ensure Ubuntu has the latest available package information. Once the package list is updated, you can install the UnRAR utility using the APT package manager.

Update Package List

First, open the Terminal and run the following command to update your Ubuntu package list:

sudo apt update

This command refreshes the local package index so APT can retrieve the latest available package information from the configured repositories.

Install UnRAR

Once your package list is updated, install UnRAR using the following command:

sudo apt install unrar

Enter your password if prompted and confirm the installation by typing Y.

Note:

The unrar package is available in the Multiverse repository. If APT cannot locate the package, make sure this repository is enabled. If you’ve faced any errors, use the command below to enable it:

sudo add-apt-repository multiverse
sudo apt update
sudo apt install unrar

Verify unrar Installation

After installation, check whether UnRAR is installed correctly by running the command below. If the installation is successful, the Terminal displays the UnRAR version and available commands.

unrar

Extract RAR Files on Ubuntu Using Terminal

After installing UnRAR, you can use the Terminal to extract RAR archives on Ubuntu. The unrar command provides several options to extract files, choose a destination directory, and view archive contents.

Extract a RAR File in the Current Directory

To extract a RAR archive into your current working directory, use the following command. Replace filename.rar with the name of your RAR archive.

unrar x filename.rar

UnRAR extracts the archive contents into the current directory while preserving the original folder structure.

Extract RAR Files to a Specific Directory

If you don’t want to extract the contents of a RAR archive into the current directory, you can specify the destination path to extract them into a specific directory.

unrar x filename.rar /path/to/directory/

Replace your filename with filename.rar and your directory address with /path/to/directory/. If the destination directory doesn’t exist, the unrar command will automatically create the directory.

List the Contents of a RAR Archive

You can also list the contents of an archive file before extracting it and verify which files and folders it contains using the l option:

unrar l filename.rar

Extract RAR Files Without Preserving Folder Structure

When extracting a RAR archive, you can choose whether to preserve its original directory structure or extract all files into a single directory.

To extract all files into one destination directory without recreating the folders stored in the archive, use the unrar e command. This extracts files from all subdirectories directly into the specified destination directory.

unrar e filename.rar /path/to/directory/

Important:

If different folders inside the archive contain files with identical names, extracting them into a single directory can cause filename conflicts. In such cases, use unrar x to preserve the original directory structure and avoid potential conflicts.

Extract Password Protected RAR File in Ubuntu

Some RAR archives are protected with a password to prevent unauthorized access to their contents. You can extract these archives on Ubuntu using UnRAR by providing the correct password when prompted.

To extract a password-protected RAR file, you can use the same command as you would for a regular RAR archive. However, UnRAR will prompt you to enter the archive password before starting the extraction. Enter the correct password and press Enter to extract the files and access their contents.

unrar x filename.rar

Enter password when prompted and press Enter:

Password prompt
Enter password (will not be echoed):

Note:

You can also use the other UnRAR commands and options covered in this guide to extract password-protected RAR archives. The only difference is that UnRAR will prompt you to enter the correct password before extracting the files. If you downloaded the archive from a website, check the download page or accompanying instructions, as the password may be provided there.

Extract Multi Part RAR Archives in Ubuntu

You can also extract multi-part RAR archives, which are large compressed files split into several smaller volumes. This is commonly done to make large files easier to upload, download, and transfer.

These files usually contain multiple files with names such as backup.part1.rar, backup.part2.rar. To extract them on Ubuntu, you need all parts of the archive in the same directory.

Identify the RAR Archive Parts

Before extracting a multi-part RAR archive, make sure all its volumes have been downloaded and placed in the same directory to be able to extract them. For example:

Example
backup.part1.rar
backup.part2.rar
backup.part3.rar
backup.part4.rar

The first volume usually has the .part1.rar extension. Make sure none of the parts are missing or corrupted, as UnRAR needs all volumes to reconstruct the original files.

Extract Multi-Part RAR Files Using UnRAR

Using UnRAR, you can easily extract them because these files are most of the time linked to each other, so you can just specify the first file name, and UnRAR will automatically detect the others and extract them too, but you should make sure all the files are in the same directory.

To extract them, navigate to the directory containing the archive parts and run the following command :

unrar x filename.part1.rar

Replace the filename.part1.rar with your own file name and run the command above. If you want to extract the file to a specific directory, you can easily specify the directory address in the command.

unrar x filename.part1.rar /home/user/extracted/

Important:

Always start extracting from the first volume (part1.rar). You don’t need to extract each volume separately. If a volume is missing during the extraction or corrupted, UnRAR will report an error and may be unable to complete the extraction.

Extract RAR Files Using Ubuntu GUI

If you prefer using a graphical interface instead of Terminal, you can extract RAR files on Ubuntu using the built-in Archive Manager. It allows you to open compressed archives, browse their contents, and extract files without running commands.

Ubuntu’s Archive Manager may require additional packages to support RAR archives. If you cannot open a RAR file, install the required extraction utility first.

Open a RAR File Using Archive Manager

To open a RAR archive, you can use the Archive Manager itself to open and navigate a RAR file by right-clicking on your RAR file and selecting Open With Archive Manager. If you don’t have this option, it means it is not installed. You can instead install File Roller on your Ubuntu using the command below:

Open a new terminal by pressing Ctrl + Alt + T. Then run the command below to install it.

sudo apt update 
sudo apt install file-roller

Also install RAR support to be able to manage RAR files:

sudo apt install unrar

After installing these, you will be able to manage RAR files using a graphical interface. Now right-click on your RAR file, select Open With ….

open rar file in ubuntu with file roller

On the opening page, select File Roller and check the checkbox below to set File Roller as the default app to open RAR files.

select file roller as default app to open rar file in Ubuntu

You can now browse the RAR archive’s contents, but you cannot directly add or modify files inside it. To add new files or make changes, you must first extract the archive. Once you’ve checked its contents, right-click the RAR file and select Extract Here or Extract To to extract its files to your preferred location.

Third-party Apps to Extract RAR Files in Ubuntu

There are several archive management and compression applications besides UnRAR on Linux VPS; you can use WinRAR, 7-Zip, and some other available applications too. They allow you to create, extract, browse, and manage compressed files such as RAR, ZIP, 7Z, TAR, and GZ.

Most of these tools are available through both command-line utilities and graphical interfaces, allowing you to manage compressed files using either method. The table below compares some popular archive management tools and their Terminal and GUI support.

ToolTerminal (CLI)Graphical Interface (GUI)
7-ZipYesYes
WinRARYesYes
PeaZipYesYes
BandizipYesYes
WinZipYesYes
NanaZipNoYes
File Roller (Archive Manager)No native CLIYes
ArkNo native CLIYes

Note:

CLI support depends on the operating system. WinRAR offers CLI tools on Windows, while Linux uses separate rar and unrar utilities from RARLAB.

Conclusion

Ubuntu doesn’t support RAR extraction by default, but installing UnRAR allows you to manage RAR archives easily. Using the commands and methods covered in this guide, you can extract regular, multi-part, and password-protected RAR files to the current or a different directory.

You can also use third-party tools such as WinRAR and 7-Zip through graphical or command-line interfaces to manage RAR archives and have more control over their contents.

Choosing the tool and interface depends entirely on your preferences. All of these tools can be used to manage RAR files. However, if you want more control over compressed files or need support for other archive formats, you can install and use third-party archive management applications.

Share:

Was this article helpful?

Your feedback helps us improve our technical guides.

Related Posts

You May Also Like

Explore more tutorials, guides, or documentation, from VPSMakers.

Learn how to easily update MikroTik router firmware manually using winbox and CLI. Stay up to date with the latest updates!
Jacob Rafet
November 24, 2026
default RDP port is (3389) and to increase the security of all Windows Server 2012, 2016, 2019 and 2022, you can change it with registry editor and PowerShell.
Robert Smith
November 23, 2026
Learn how to change the default MikroTik WinBox port using Terminal or WinBox and allow connections through the new port in the firewall.
Jacob Rafet
November 22, 2026
Learn how to extract regular, multi-part, and password-protected RAR files on Ubuntu VPS using command-line and graphical tools.
Richard Mourar
November 21, 2026