How to Use RAR files in Ubuntu Linux

Looking for WinRAR in Linux? Here’s how to extract and use RAR files in Linux.

RAR is a quite good archive file format. It is one of the most popular archive formats.

By default, Ubuntu's archive manager does not support extracting RAR files nor does it let you create RAR files. It would rather show you this error:

There is no command installed for RAR archive files. Do you want to search for a command to open this file?

Ubuntu RAR File Error

Sometimes extracting RAR files will show you "Extraction not performed" error.

Error in RAR extraction in Ubuntu

Fret not. We have a solution for you. To enable the support to extract RAR files, you need to install UNRAR – which is a freeware by RARLAB. And, to create and manage RAR files, you need to install RAR.

Install RAR support in Ubuntu

Launch the terminal and type in the following command to make sure you have multiverse repository enabled in Ubuntu:

sudo add-apt-repository multiverse

Update the package cache:

sudo apt update

Now, if you just want to extract RAR files in Ubuntu, simply install the unrar package like this:

sudo apt install unrar

If you also want to create RAR files, you should install this file.

sudo apt install rar

Extracting RAR Files in Ubuntu Linux

After installing unrar, you may choose to type in “unrar” (without the inverted commas) to know more about its usage and how to use RAR files with the help of it.

The most common usage would obviously be extracting the RAR file you have. So, you can either perform a right-click on the file and proceed to extract it from there or you can do it via the terminal with the help of this  command:

unrar x FileName.rar

You can see that in action here:

Using unrar in Ubuntu

If the file isn’t present in the Home directory, then you have to navigate to the target folder by using the cd command in Linux. For instance, if you have the archive in the Music directory, simply type in “cd Music” to navigate to the location and then extract the RAR file.

Creating & Managing RAR files in Ubuntu Linux

UNRAR does not let you create RAR files. So, you need to install the RAR command-line tool to be able to create RAR archives.

To do that, you need to type in the following command:

sudo apt-get install rar

Here, we will help you create a RAR file. In order to do that, follow the command syntax below:

rar a ArchiveName File_1 File_2 Dir_1 Dir_2

When you type a command in this format, it will add every item inside the directory to the archive. In either case, if you want specific files, just mention the exact name/path.

By default, the RAR files reside in HOME directory.

Using rar archive in Ubuntu Linux

In the same way, you can update/manage the RAR files. Just type in a command using the following syntax:

rar u ArchiveName Filename

To get the list of commands for the RAR tool, just type “rar” in the terminal.

Wrapping Up

Now that you’ve known how to use RAR files on Ubuntu, will you prefer using it over 7-zip, Zip, or Tar.xz?

Let us know your thoughts in the comments below.

About the author
Ankush Das

Ankush Das

A passionate technophile who also happens to be a Computer Science graduate. You will usually see cats dancing to the beautiful tunes sung by him.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.