rar ubuntu

RAR is a proprietary archive file format. On Linux, it’s not as commonly used as zip or tarballs, but it’s still fairly popular. You can use the default archiving tool if you simply want to extract RAR files. If you’re trying to package files as RAR instead, you’ll have to install and use the command line rar tool.

Install and Use rar

First, install the rar tool with

sudo apt install rar

Extract RAR Files

Now, specify the archive name and use the x flag to extract the files like so

rar x myarchive

If you have a multi-part RAR file, ensure all the files are in the current directory. Then, simply extract the first file to auto-extract the entire archive.

rar x myarchive.part01

Package RAR Files

Creating a RAR archive is also very simple. Once again, specify the archive name and use the a flag to add files like so

rar a myarchive file1 file2 folder1

Extract RAR Files via GUI

You can right-click your RAR archive and select the Extract options to extract the files. This is convenient, but it’s not always ideal. 

We extracted files with the full path in the previous method. But here, if your archive has other archives inside (e.g., zip files or other RAR files), those files will be directly auto-extracted. Files with the same names in different subdirectories may also be overwritten.

Basically, the GUI extraction tool works if you’re extracting a simple RAR archive with a few files. But if things like subdirectories and embedded archives are involved, we recommend sticking to the CLI method.

Anup Thapa

Senior Writer

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys reading up on a range of topics, traveling, working out, and MOBAs.