How to install rar and unrar in CentOS 7 VPS

How to install rar and unrar in CentOS 7 VPS

RAR files are archived by Winrar compression software and can be split into large files. In this tutorial, we are going to explain how to install rar and unrar on Linux CentOS 7.

Install rar

First, download the rar package with the wget command.

# wget https://www.rarlab.com/rar/rarlinux-x64-5.7.1.tar.gz

Output sample:

[[email protected] ~]# wget https://www.rarlab.com/rar/rarlinux-x64-5.7.1.tar.gz
--2019-08-03 07:58:21-- https://www.rarlab.com/rar/rarlinux-x64-5.7.1.tar.gz
Resolving www.rarlab.com (www.rarlab.com)... 5.135.104.98
Connecting to www.rarlab.com (www.rarlab.com)|5.135.104.98|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 546592 (534K) [application/x-gzip]
Saving to: ‘rarlinux-x64-5.7.1.tar.gz’
100%[=======================================================================================================================================>] 546,592 651KB/s in 0.8s
2019-08-03 07:58:22 (651 KB/s) - ‘rarlinux-x64-5.7.1.tar.gz’ saved [546592/546592]
[[email protected] ~]#

Extract the downloaded file using the tar command.

# tar -xzvf rarlinux-x64-5.7.1.tar.gz

Output sample:

[[email protected] ~]# tar -xzvf rarlinux-x64-5.7.1.tar.gz
rar/
rar/order.htm
rar/acknow.txt
rar/readme.txt
rar/default.sfx
rar/license.txt
rar/rarfiles.lst
rar/whatsnew.txt
rar/makefile
rar/rar
rar/unrar
rar/rar.txt
[[email protected] ~]#

Log in to the tar directory using the cd command.

[[email protected] ~]# cd rar
[[email protected] rar]# ls
acknow.txt  default.sfx  license.txt  makefile  order.htm  rar  rarfiles.lst  rar.txt  readme.txt  unrar  whatsnew.txt
[[email protected] rar]#

Set the environment variables by copying the rar and unrar files to /usr/local/bin/.

Install rar

[[email protected] ~]# cp -v rar unrar /usr/local/bin/
‘rar’ -> ‘/usr/local/bin/rar’
‘unrar’ -> ‘/usr/local/bin/unrar’
[[email protected] ~]#

You can run these commands in your terminal to confirm the functionality of the rar and unrar application.

[[email protected] ~]# rar

RAR 5.71   Copyright (c) 1993-2019 Alexander Roshal   28 Apr 2019
Trial version             Type 'rar -?' for help

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

<Commands>
  a             Add files to archive
  c             Add archive comment
  ch            Change archive parameters
  cw            Write archive comment to file
  d             Delete files from archive
  e             Extract files without archived paths
.
.
.
.

It is finished. As a result, this way you can install rar and unrar on your CentOS Linux VPS server. Good luck.

Was this post helpful?

About the Author
Harry H
I'm Harry, I love my job, I love to help, share information and to always learn.

Leave a Reply

12 − 1 =