How To Install rar on Ubuntu 22.04

In this tutorial we learn how to install rar on Ubuntu 22.04. rar is Archiver for .rar files

Introduction

In this tutorial we learn how to install rar on Ubuntu 22.04.

What is rar

rar is:

This is the RAR archiver from Eugene Roshal. It supports multiple volume archives and damage protection. It can also create SFX-archives. There are versions which run on DOS, Windows (3.1x,95,NT), FreeBSD, BSDI.

This program is shareware and you must register it after 40 days of use.

There are three methods to install rar on Ubuntu 22.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install rar Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install rar using apt-get by running the following command:

sudo apt-get -y install rar

Install rar Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install rar using apt by running the following command:

sudo apt -y install rar

Install rar Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install rar using aptitude by running the following command:

sudo aptitude -y install rar

How To Uninstall rar on Ubuntu 22.04

To uninstall only the rar package we can use the following command:

sudo apt-get remove rar

Uninstall rar And Its Dependencies

To uninstall rar and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove rar

Remove rar Configurations and Data

To remove rar configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge rar

Remove rar configuration, data, and all of its dependencies

We can use the following command to remove rar configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge rar

References

Summary

In this tutorial we learn how to install rar package on Ubuntu 22.04 using different package management tools: apt, apt-get and aptitude.