unrar is a command line application for extracting compressed Roshal Archive (.rar) files on *nix-based operating systems. 7-Zip, PeaZip, and GNOME Archive Manager are good graphical applications for managing compressed files on desktop systems. But depending on your workflow, you may need a solution available on your Linux VPS. Note that the terminal application is oftentimes already included with popular Linux desktop distributions.
You’ll need Secure Shell (SSH) access with root privileges to install the unrar and rar applications.
Installing and Using the unrar and rar Unix Terminal Application
You can check if unrar is installed running the unrar
terminal command. If it isn’t installed already, log into SSH and follow the installation instructions for your operating system (OS).
Install unrar Linux app on CentOS:
- Navigate to your temporary directory in SSH:
cd /tmp/
- Visit the official WinRAR website – https://www.rarlab.com/download.htm.
- Right-click the latest RAR version for Linux x64 and select “Copy Link.”
- Type “wget” and paste the copied download link in your terminal to download RAR archiver. For example, to download RAR 6.02:
wget https://www.rarlab.com/rar/rarlinux-x64-6.0.2.tar.gz
- Extract the RAR download:
tar -zxvf rarlinux-x64-6.0.2.tar.gz
- Copy the extracted /rar and /unrar application directories into your /bin directory:
cp -v rar/rar rar/unrar /usr/local/bin/
Install unrar on CentOS (with cPanel or FTP):
- Visit https://www.rarlab.com/download.htm.
- Download the latest RAR version for Linux x64 to your local machine.
- Upload the tar archive to your Linux VPS using FileZilla or cPanel File Manager.
- Extract the compressed archive.
- Log into SSH or WebHost Manager (WHM) Terminal as root.
- Navigate (
cd
) to the directory with the extracted rar archive. - Copy the extracted /rar and /unrar application directories into your /bin directory:
cp -v rar/rar rar/unrar /usr/local/bin/
- After testing that the
rar
andunrar
commands work, you should remove the tar file.
Install unrar on Debian / Ubuntu (one of the following):
sudo apt-get install unrar-free
sudo apt install unrar-free
Install unrar on Arch / Manjaro:
sudo pacman -S unrar
Install unrar on FreeBSD:
sudo pkg install unrar
You can download the unrar macOS application from https://www.rarlab.com/download.htm.
How to unrar a file to the current directory:
unrar e file.rar
Create a rar archive:
rar a file.rar textfile.txt audiofile.mp3 videofile.flac
Password protect a rar archive:
unrar a -p file.rar
Then type a strong password twice.
List archived files:
unrar l file.rar
Integrity check a rar file:
unrar t file.rar
Learn more about the unrar and rar applications:
man unrar
man rar
Now you have an additional terminal application when unable to use tar or zip.
No matter if you're a developer, system administrator, or simply a fan of SSH and command line, InMotion's Cloud Hosting plans provide a fast, scalable environment that is budget-friendly.