Install UNRAR on Fedora Linux 35

UNRAR is widely known and used amongst Windows users. RAR files are much smaller archives and compress better than ZIP for most files by compressing files “together,” saving more space. UNRAR does not come pre-installed natively on Fedora and is not featured in its repositories.

The following tutorial will show you how to install UNRAR on Fedora Linux 35 Workstation or Server with RPM FUSION, along with the most commonly used commands.

Prerequisites

  • Recommended OS: Fedora Linux 35.
  • User account: A user account with sudo or root access.
  • Internet Access

The tutorial will utilize the terminal, which can be found in your show applications menu.

Example:

Install UNRAR on Fedora 35 Linux

Update Operating System

Update your Fedora operating system to make sure all existing packages are up to date:

sudo dnf upgrade --refresh -y

The tutorial will be using the sudo command and assuming you have sudo status.

To verify sudo status on your account:

sudo whoami

Example output showing sudo status:

[joshua@fedora ~]$ sudo whoami
root

To set up an existing or new sudo account, visit our tutorial on Adding a User to Sudoers on Fedora.

Use the following command with the root password to log in to use the root account.

su

Install Dependency Required

Before installing, run the following command to ensure the following packages are installed.

sudo dnf install dnf-plugins-core -y

Install RPM Fusion Repository

By default, UNRAR is not available in Fedora 35’s default repository, so you will need to install the famous RPM Fusion repository that contains the package along with many other free and proprietary popular packages.

To install the RPM Fusion repo’s in your terminal, you will execute the following commands.

Install/Enable the RPM Fusion Free Repository:

sudo dnf install \
  https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm

Install/Enable the RPM Fusion Non-Free Repository:

sudo dnf install \
  https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Next, verify the installation.

dnf repolist | grep rpmfusion

Example output:

rpmfusion-free                 RPM Fusion for Fedora 35 - Free
rpmfusion-free-updates         RPM Fusion for Fedora 35 - Free - Updates
rpmfusion-nonfree              RPM Fusion for Fedora 35 - Nonfree
rpmfusion-nonfree-updates      RPM Fusion for Fedora 35 - Nonfree - Updates

Install UNRAR

With RPM Fusion imported, you can now begin the installation. In your terminal, use the following command.

sudo dnf install unrar

Example output:

Install UNRAR on Fedora 35 Linux

Type Y, then press the ENTER KEY to proceed.

Lastly, verify the version installed to make sure the installation was successful.

unrar -version

Example output:

UNRAR 6.10 beta 3 freeware      Copyright (c) 1993-2021 Alexander Roshal

How to Use UNRAR

Below are some basic commands and examples of using UNRAR. While they do not show everything possible, they cover 75% of what most users would use UNRAR for regularly.

The first command that is most helpful before the tutorial continues further is the help command.

unrar

Example output:

Usage:     unrar <command> -<switch 1> -<switch N> <archive> <files...>
               <@listfiles...> <path_to_extract\>

<Commands>
  e             Extract files without archived paths
  l[t[a],b]     List archive contents [technical[all], bare]
  p             Print file to stdout
  t             Test archive files
  v[t[a],b]     Verbosely list archive contents [technical[all],bare]
  x             Extract files with full path

<Switches>
  -             Stop switches scanning
  @[+]          Disable [enable] file lists
  ad[1,2]       Alternate destination path
  ag[format]    Generate archive name using the current date
  ai            Ignore file attributes
  ap<path>      Set path inside archive
  c-            Disable comments show
  cfg-          Disable read configuration
  cl            Convert names to lower case
  cu            Convert names to upper case
  dh            Open shared files
  ep            Exclude paths from names
  ep3           Expand paths to full including the drive letter
  ep4<path>     Exclude the path prefix from names
  f             Freshen files
  id[c,d,n,p,q] Display or disable messages
  ierr          Send all messages to stderr
  inul          Disable all messages
  kb            Keep broken extracted files
  me[par]       Set encryption parameters
  n<file>       Additionally filter included files
  n@            Read additional filter masks from stdin
  n@<list>      Read additional filter masks from list file
  o[+|-]        Set the overwrite mode
  ol[a]         Process symbolic links as the link [absolute paths]
  op<path>      Set the output path for extracted files
  or            Rename files automatically
  ow            Save or restore file owner and group
  p[password]   Set password
  r             Recurse subdirectories
  sc<chr>[obj]  Specify the character set
  si[name]      Read data from standard input (stdin)
  sl<size>      Process files with size less than specified
  sm<size>      Process files with size more than specified
  ta[mcao]<d>   Process files modified after <d> YYYYMMDDHHMMSS date
  tb[mcao]<d>   Process files modified before <d> YYYYMMDDHHMMSS date
  tn[mcao]<t>   Process files newer than <t> time
  to[mcao]<t>   Process files older than <t> time
  ts[m,c,a,p]   Save or restore time (modification, creation, access, preserve)
  u             Update files
  v             List all volumes
  ver[n]        File version control
  vp            Pause before each volume
  x<file>       Exclude specified file
  x@            Read file names to exclude from stdin
  x@<list>      Exclude files listed in specified list file
  y             Assume Yes on all queries

Extract a RAR Archive Current Directory

To extract or open a RAR file in a current directory, use the unrar e command.

unrar e {file-name}.rar

Extract a RAR Archive to Folder

To extract or open a RAR file that needs a specific path or destination directory, use the following unrar e command again, followed by the full path of the final destination.

unrar e {file-name}.rar /target/path

Example:

unrar {filename}.rar /opt/

Extract a RAR Archive with Directory Structure

To extract a RAR archive with their directory structure, use the unrar x command.

unrar x {filename}.rar

List a RAR File

To list the files in a RAR file, use the following unrar l command. Additionally, list archive contents [technical[all], bare].

unrar l[technical[all], bare] {filename}.rar

Example:

unrar l[t[a],b] {filename}.rar

Test a RAR File

To test the files in a RAR file, use the following unrar t command.

unrar t {filename}.rar

Comments and Conclusion

In the tutorial, you have learned how to install UNRAR on Fedora Linux 35 and use the most common commands. Overall, UNRAR is an excellent option for constant use of extensive archives that need compressing, especially if working between multiple operating systems such as Windows or macOS.



Follow LinuxCapable.com!

Like to get automatic updates? Follow us on one of our social media accounts!