Jan 25, 2024 5 min read

How to Install UNRAR on Ubuntu 22.04

Install unrar on ubuntu 22.04 with our step-by-step tutorial. It is a command-line utility for extracting RAR archives.

Install UNRAR on Ubuntu 22.04
Install UNRAR on Ubuntu 22.04
Table of Contents

Choose a different version or distribution

Introduction

Before we discuss how to install unrar on ubuntu 22.04, let's first understand-What is UNRAR?

UNRAR is a command-line utility for extracting RAR archives. RAR files are a popular compression format used to store multiple files in a single archive. UNRAR allows Ubuntu 22.04 users to extract files from RAR archives effortlessly.

This tutorial will explain how to install UNRAR on Ubuntu 22.04.

Advantages

  1. RAR Archive Support: UNRAR enables Ubuntu 22.04 users to extract files from RAR archives, allowing access to the content stored in these files.
  2. Wide Compatibility: UNRAR is compatible with various versions of RAR archives, ensuring that you can extract files from both older and newer RAR files.
  3. Command-Line Interface: UNRAR's command-line interface makes it easy to use in scripting or automation tasks, allowing you to extract files programmatically.
  4. Efficient Extraction: UNRAR's extraction process is fast and efficient, ensuring that you can extract files from RAR archives quickly without consuming excessive system resources.
  5. Stability and Reliability: UNRAR is a stable and reliable utility that has been widely used for many years, guaranteeing a dependable extraction experience.

Steps for UNRAR installation on Ubuntu 22.04

Step 1. Check whether UNRAR is installed or not

There is a possibility that unrar can be already installed on your Ubuntu system, but you are unaware of it.

So we have to check if this tool already exists using the following command:

unrar -v

If the tool is already present in the system then it will provide you the details of its installed version, whereas if it's not installed then it will display a message stating that "command unrar not found".

unrar not found

Step 2. Update your package and Install UNRAR

To update using the apt package, run the following command:

sudo apt update

Now, run the installation command:

sudo apt install unrar
Install unrar

Press 'Y' to give you permission to install it, and then press the Enter key.

After the installation is finished, you can use the following to verify that the unrar version is present on your Linux system:

unrar -v

Step 3.  Commands to use with Unrar

Following are the list of commands that can be used to extract, decompress or manage RAR-based archives.

ℹ️
NOTE:Unrar only allows you to extract archives; to generate RAR-based archives, use sudo apt install rar to install the "rar" utility.

1. Use UNRAR to extract files without archived paths.

If you want to extract all files from the RAR archive into the current directory. Then the command will be:

unrar e sample-1.rar

The “e” option stands for “extract”.

💡
Note: Replace sample-1.rar with your filename. Additionally, use the following command if you wish to extract the files inside a folder rather than all of the files in your current folder.

2. Extract with full path

To extracts all files and directories from the RAR archive while preserving the original directory structure, run the following command:

unrar x sample-1.rar

"Extract with full path," denoted by the "x" option, will be employed.

3. Password Protected RAR files

If your RAR file is password-protected, you can extract it by using the regular x option along with the -p switch:

unrar x p sample-1.rar

4. List of the files inside a RAR archive

Shows a list of the RAR archive's files without actually extracting them. The “l” option stands for “list”.

unrar l sample-1.rar
List of files

5. Display detailed files info present inside the RAR archive

To display detailed files information, run the following command:

unrar v sample-1.rar

The “v” option stands for “verbose”.

Detailed files information

6. Verifies that the RAR archive is intact.

To perform an integrity test before exacting a file using Unrar command for checking any errors or corruption, we can use the option “t” option that stands for “test”.

unrar t sample-1.rar
Tests Integrity

Uninstallation

For whatever reason, do the following to delete the tiny UNRAR utility from your Ubuntu 22.04 or 20.04 Linux system:

sudo apt remove unrar

FAQs to Install Unrar on Ubuntu 22.04

How do I extract a RAR file using UNRAR? 

To extract a RAR file, use the following command in the terminal: unrar x <path_to_rar_file>. Replace <path_to_rar_file> with the actual path to your RAR file.

Can I extract password-protected RAR files using UNRAR? 

Yes, you can extract password-protected RAR files with UNRAR. You will be prompted to enter the password during the extraction process.

Can UNRAR create RAR archives? 

No, UNRAR is only capable of extracting files from RAR archives. If you need to create RAR archives, you can use other tools like WinRAR or RAR for Linux.

Are there any graphical user interface (GUI) alternatives to UNRAR on Ubuntu? 

Yes, Ubuntu offers various GUI-based file archive managers like File Roller, Ark, or Xarchiver that can handle RAR files in addition to other archive formats.

Can I extract files from split RAR archives using UNRAR?

Yes, UNRAR can handle split RAR archives (.rar, .r00, .r01, etc.). Simply provide the path to the first part of the split archive during the extraction.

Can UNRAR extract files with non-English characters in the file names? 

Yes, UNRAR supports extracting files with non-English characters or filenames encoded in different character sets.

Does UNRAR support RAR archives encrypted with AES-256? 

Yes, UNRAR supports extracting files from RAR archives encrypted with AES-256 encryption. You will be prompted to enter the password during extraction.

Conclusion

We have covered various steps on how to install unrar on ubuntu 22.04 in this tutorial.

If you have any queries, feel free to ask them in the comments section, and we would be happy to respond to them....

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Tutorials - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.