How to Extract a RAR Archive on Linux: 10 Steps (with Pictures)

Table of contents:

How to Extract a RAR Archive on Linux: 10 Steps (with Pictures)
How to Extract a RAR Archive on Linux: 10 Steps (with Pictures)

Video: How to Extract a RAR Archive on Linux: 10 Steps (with Pictures)

Video: How to Extract a RAR Archive on Linux: 10 Steps (with Pictures)
Video: how to copy and paste an email 2024, May
Anonim

Roshal Archive (RAR) is a file format designed for compressing and archiving data. Once you've downloaded the RAR file from the internet, you'll need a program to extract the file. Since programs for extracting RAR are generally not installed by default on Linux, you will have to download programs from other sources. This article will guide you to download unrar and use it to extract RAR files on Linux.

Step

Method 1 of 2: Installing the Unrar App

Unrar Files in Linux Step 1
Unrar Files in Linux Step 1

Step 1. Make sure your computer is connected to the internet

Unrar Files in Linux Step 2
Unrar Files in Linux Step 2

Step 2. If you are using a graphical interface, switch to the shell view

  • The shell view can be accessed by pressing Control + alt=""Image" + F1.</li" />
  • You can also open the Terminal application from the System Tools folder. This application can be used to access the shell.
  • Enter the command below on the command line interface, either in the shell view or in Terminal.
Unrar Files in Linux Step 3
Unrar Files in Linux Step 3

Step 3. Use the proper command to download unrar to your Linux installation

The command below must be run with root privileges. Therefore, before trying the command, log in as root with the "su" command, or prefix the command with "sudo". Enter the root username and password to continue.

  • If you are using Debian and its derivatives (including Ubuntu), enter the command “apt-get install unrar” or “apt-get install unrar-free”.
  • If you are using Fedora Core, enter the command “yum install unrar”.
  • If you are using Arch Linux, install unrar from the "extra" repository with the command "pacman -S unrar".
  • If you are using OpenBSD, use the command “pkg_add –v –r unrar”.
  • If you are using Suse10, enter the command “yast2 –i unrar”.
  • If you are using Suse11, enter the command “zipper install unrar”.
Unrar Files in Linux Step 4
Unrar Files in Linux Step 4

Step 4. If the above command doesn't work, download unrar directly from rarlab

  • Enter "cd /tmp".
  • Enter “wget
  • Extract the file with the command “tar -zxvf rarlinux-3.9.1.tar.gz”.
Unrar Files in Linux Step 5
Unrar Files in Linux Step 5

Step 5. Find the rar and unrar commands in the rar folder

  • Insert "CD rar".
  • Enter "./unrar".
Unrar Files in Linux Step 6
Unrar Files in Linux Step 6

Step 6. Copy the rar and unrar files to the /usr/local/bin directory with the following command:

"cp rar unrar /usr/local/bin". After running the command, you can use unrar on your Linux computer.

Method 2 of 2: Using the Unrar App

Unrar Files in Linux Step 7
Unrar Files in Linux Step 7

Step 1. Extract the file with its full address with the command “unrar x file.rar”

Generally, you can use this command to extract files.

Unrar Files in Linux Step 8
Unrar Files in Linux Step 8

Step 2. Extract all files (except folders) in the RAR archive to the current directory with the command “unrar e file.rar”

Unrar Files in Linux Step 9
Unrar Files in Linux Step 9

Step 3. Display the list of files in the RAR archive with the command “unrar l file.rar”

Unrar Files in Linux Step 10
Unrar Files in Linux Step 10

Step 4. Test the integrity of the archive with the command “unrar t file.rar”

Tips

  • If you have trouble using the command line interface and want to extract a RAR archive with a graphical interface, you can try PeaZip. The application is compatible with GNOME and KDE, and is available in DEB or RPM formats.
  • RAR3 is the latest version of the RAR format. RAR3 supports the Advanced Encryption Standard with 128-bit keys, files with Unicode names, and files larger than 4 GB.
  • You can only create RAR files with commercial applications. However, you can extract RAR files on Linux with the unrar command, which can be downloaded for free.
  • File Roller (the default archive manager in GNOME-based distributions) can use a command line program to extract RAR files. After installing unrar in the /usr/local/bin/ (or similar) folder, File Roller will use this command to extract the RAR file.
  • If a RAR file is split into several smaller files, the RAR file will have the extensions.rar,.r00,.r01, and so on. Use the unrar program to extract the main.rar file, and it will extract the remaining fragments automatically.

Recommended: