LinuxTutorialsUbuntu

How To Install Rar/Unrar Packages on Ubuntu

Install Rar/Unrar Packages on Ubuntu

In this tutorial, we will show you how to install Rar/Unrar packages on your Ubuntu. For those of you who didn’t know, RAR and UnRAR are software utilities designed for file compression and decompression, respectively. These tools can be incredibly useful for compressing files and saving disk space or transferring files over the internet. However, installing these packages on Ubuntu may seem challenging for users who are new to the Linux environment. In this article, we will discuss the steps to install RAR and UnRAR packages on Ubuntu.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of Rar/Unrar on Ubuntu systems.

Prerequisites

  • A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint or elementary OS.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Rar/Unrar Packages on Ubuntu

Step 1. First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal.

sudo apt update
sudo apt upgrade

Step 2. Installing Rar/Unrar Packages on Ubuntu.

  • Method 1: Using Terminal.

By default, the Rar/Unrar is available on the Ubuntu base repository. Now run the following command below to install the latest version of Rar/Unrar to your Ubuntu system:

sudo apt install rar
sudo apt install unrar
  • Method 2: Using Synaptic Package Manager.
  1. Open the Synaptic Package Manager by searching for it in the Ubuntu Software Center.
  2. Search for RAR and select the package from the list.
  3. Click on the “Mark for Installation” option and then click on the “Apply” button to install the package.
  4. Follow the same steps to install the UnRAR package.

Commands for Rar/Unrar archive

RAR and UnRAR are command-line utilities that allow you to compress and decompress files in the RAR archive format. Here are some of the most commonly used RAR and UnRAR commands with examples:

RAR Commands:

  • rar a [archive_name] [file/directory_name]

This command creates a new RAR archive with the given name and adds the specified file or directory to it. Example:

rar a archive.rar myfile.txt
  • rar x [archive_name] [destination_directory]

This command extracts the files and directories from the RAR archive to the specified destination directory. Example:

rar x archive.rar /home/user/documents

This will extract all the files and directories from the RAR archive “archive.rar” to the directory “/home/user/documents“.

  • rar t [archive_name]

This command tests the integrity of the RAR archive and lists the files contained in it. Example:

rar t archive.rar

This will test the integrity of the RAR archive “archive.rar” and display the list of files contained in it.

UnRAR Commands:

  • unrar x [archive_name] [destination_directory]

This command extracts the files and directories from the RAR archive to the specified destination directory. Example:

unrar x archive.rar /home/user/documents

This will extract all the files and directories from the RAR archive “archive.rar” to the directory “/home/user/documents“.

  • unrar l [archive_name]

This command lists the files contained in the RAR archive. Example:

unrar l archive.rar

This will list all the files contained in the RAR archive “archive.rar“.

  • unrar e [archive_name] [file_name]

This command extracts a single file from the RAR archive to the current directory. Example:

unrar e archive.rar myfile.txt

This will extract the file “myfile.txt” from the RAR archive “archive.rar” to the current directory.

Congratulations! You have successfully installed rar or unrar. Thanks for using this tutorial for installing rar or unrar in the Ubuntu system. For additional help or useful information, we recommend you check the official rar website

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “Rar/Unrar” installation, starting from $10 (Paypal payment). Please contact us to get the best deal!

Save

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button