Open RAR File / Extract RAR Files Under Linux or UNIX

Posted on in Categories , , , , , , , , , , , , last updated September 16, 2015

How do I open rar archive files under a Linux or UNIX or OS X operating system?

RAR files are in compressed archive format, if you have downloaded rar files from the Internet, you need to unpack or unrar them (extract rar files). RAR is a proprietary file format for data compression and archiving, developed by Eugene Roshal. The command used to extract these files is called “unrar”. By default, unrar is not being installed on Linux, FreeBSD or UNIX like operating system. You can install unrar command with the help of apt-get or yum command. (See below for Windows XP / 7 unrar infomation.)

Install unrar command

Under Debian or Ubuntu Linux, you need to type apt-get command as follows to install unrar program:
# apt-get install unrar
$ sudo apt-get install unrar

If you are using Fedora Linux / CentOS / RHEL, use the yum command as follows (see discussion below for more):
# yum install unrar

If you are using FreeBSD, enter:
# pkg_add -v -r unrar

If any of above, methods is not working for you, download binary package from official rarlab site:
$ cd /tmp
$ wget

$ wget
OR try 64 bit version:
$ wget

Next, untar file, enter:
$ tar -zxvf rarlinux-*.tar.gz

Both unrar and rar commands are located in rar sub-directory. Just cd to rar directory, type:
$ cd rar
$ ./unrar

Now copy rar and unrar file to /usr/local/bin directory, type:
# cp rar unrar /usr/local/bin

HowTo: Use unrar Command

The unrar command supports various options, below are common options that you need to for extracting files.

Task: Extract rar (unpack) File

To extract file.rar file into the current directory, enter:
$ unrar e file.rar

Task: List (l) file inside rar archive:

$ unrar l file.rar

Task: To extract (x) files with full path type command:

$ unrar x file.rar

To test (t) integrity of archive, file type command:

$ unrar t file.rar

How do I open rar file under MS-Windows XP/NT/2000/7/8/10?

  • If you are using MS-Windows XP / 7, download Winrar. It is free download (free to try License) software.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Share this on (or read 158 comments/add one below):

158 comment

  1. On my Redhat FC4… says there is no unrar or rar… does this package go under a different name?

    [[email protected] ~]# yum install unrar
    Setting up Install Process
    Setting up repositories
    Reading repository metadata in from local files
    Parsing package install arguments
    No Match for argument: unrar
    Nothing to do

  2. You need to point out to use dag RPM Repository for unrar command under Fedora Core Linux. I have following line in my /etc/yum.conf file:

    name=Dag RPM Repository for Fedora Core

    Save file and import PGP key:
    rpm –import

    Upgrade your system by typing following command:
    yum update

    Install unrar:
    yum install unrar

    Or just download RPM file from dag site

  3. when i try and use unrar i get the following error:

    unrar: /lib/tls/ version `GLIBC_2.4′ not found (required by unrar)

    how do i fix this? can someone perhaps kindly point me to another article or some instructions? thank you!

  4. How do I fix this error

    Cannot find volume GA_-_S2E13_-_Begin_The_Begin.part2.rar
    Grey’s Anatomy – Season 2 – Episode 13 – Begin The Begin.avi – CRC failed
    Total errors: 1

    i’m very sure that i’ve downloaded it and it is in my Desktop…


  5. There is a program – RAR fix, able can extract information even from those compressed files that are protected with a password, works with all variants of this format and can recover data from archives and corrupt rar files with various compression rates and created in different software.

  6. For Ubuntu users (I’m using 7.10) you can find it in the Synaptic package handler menu.
    Sorry for the translation if it is not accurate, I have the menu in Spanish.

  7. Hello when i execute ./rar i got this error

    -bash-3.00# ./unrar
    ./unrar: /lib/tls/ version `GLIBC_2.4′ not found (required by ./unrar)

    any body can provid a help ,


  8. Hi,

    I was getting same error.

    I installed rar and unrar through rpm and its working fine.
    rpm -ivh
    rpm -ivh

  9. I downloaded unrar successfully but i get an error when i try to open the file thats compressed. the error is:
    Warning:You need to start extraction from a previous volume to unpack file.wmv
    No files to extract

  10. thanx Mishu, nice to see Suse has a support here, i searched for long time… i will give a try tomorrow morning.

    Mishu Says:
    November 24th, 2007 at 2:36 am
    Installation For Suse 10 users:
    # su
    # yast2 -i unrar

  11. vivek sorry i am new to this linux thing would you be able to tell me what exactly do i tyoe in the terminal? like the last two command you said with superuser but how do i write that? thank you very much i appreciate it.

  12. # apt-get install unrar

    It’s not work :(

    Reading package lists… Done
    Building dependency tree… Done
    Package unrar is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    E: Package unrar has no installation candidate

    Please, help (((

  13. Thanks For The Very Good Description Here
    It Worked Perfect For Me.
    One Question
    How Do I Extract Password Protected Rars
    I Mean, I Have The Password, But How Do I Specify It In Command Line.
    Need Syntax For That

  14. @celleke
    Its Called Multi-Part Rars
    You Dont Have To Do Anything Different For That
    Heres The Ex.
    unrar e file.part01.rar

    unrar Looks For All The, I Tried And It Worked
    file.partxx.rar and Extracts It For You
    Hope It Helps

  15. has anyone a solution for that GLIBC problem?
    although the exists and has 777 the error appears, complete libc6 is installed. machine: debian7 minimal from netinst cd. thanks-a-lot!

  16. Same problem on Debian Etch…

    unrar: /lib/tls/i686/cmov/ version `GLIBC_2.4′ not found (required by unrar)

    This problem seems to pretty old… Dating back to 2007 (and even older). No-one came with a solution… I’m starting to think this Linux shit isn’t the OS for me :| Windows is easyer. So what if 99% of all viruses are made for Windows ? Ignorance is fucking biss…

  17. There is something simply called ‘rar’ which uncompress AS WELL AS compress. That means you can create, read, modify RAR archives. Its free. I don’t know about its license.

  18. Bill,

    Type the following commands as root:
    apt-get update
    apt-get upgrade
    apt-get update unrar

    Here is output from my system:
    cat /etc/debian_version
    If you need further assistance please feel free to use our forum as thread discussion is supported very well..

  19. i have been haveing trouble unzipping a file, i have tried everything, someone plz help me, email is [email protected]
    When i try to unzip my rar file directly by right clicking and saying extract here, i get this /bin/sh: /bin/rar: cannot execute binary file and when i open the terminal in the same directory this is what it says [[email protected] Panik]# unrar diablo.rar]
    bash: /bin/unrar: cannot execute binary file i dunno if im using the wrong command, i have rtyed alot, but nothing works, btw im using yellowdog 6 and io have installed unrar.

  20. Hi. thanks so much for your resources. I am new to linux, and am trying to move a joomla .zip file into the var/www/Joomla directory. I use: mv var/www/Joomla but only get:

    mv: cannot move `’ to `var/www’: No such file or directory
    What am I doing wrong pleaseÉ thanks

  21. i am unable to copy ‘rar’ and ‘unrar’ files to “/bin” from “/tmp/rar”.
    It says, permission denied.
    What to do.?
    I have downloaded “UNRAR 3.60 freeware ” in “/tmp”

  22. How do I open a binary file using Linux rar – on Redhat or Ubuntu or any linux?

    When I try this command,
    unrar e install.bin
    It throws an error – install.bin is not a rar achieve.
    No Files to extract.

    So how can I extract a binary file in linux using this unrar ?

  23. Hi everyone and thanks for your replys.
    I have a question,,
    Is it possible to extract rar files in server? (using cpanel or php script)?
    I have uploaded a rar file but I understood that my cpanel can’t extract the file content. How to extract it’s contents? Is it possible to use a php script? how?
    If RAR files , was in several parts, then what i can extract it?
    If files has password protection, what i do?

  24. hi.. i get the following while trying to install. what do i do ??
    ./unrar: error while loading shared libraries: cannot open shared object file: No such file or directory
    I try to edit /etc/ what do i write in this file?. I have libraries at /usr/lib/ Is there another solution ?

  25. Is there a trick to unpacking rar archives that are segmented? I download files that are filename1.rar filename2.rar and Winrar unpacks them just fine. Linux doesn’t, and it’s pissing me off!

  26. lately unrar was been faling when it comes to extract..
    but i found a solution …
    apt-get install unp
    unp [FILE].[Any Compress extention]

    Easy and very quickly…
    unp is a free powerfull extraction package ..
    I like use alternatives software… for any question [email protected]

  27. I finally got it to work! Success!!

    The trick is to stay the he*l away from unrar-free and just use unrar! I’m sure it will give Richard Stallman nightmares but the unfree version worked (finally!) This process was much easier with WinRAR and I had success much earlier, but it’s nice to finally get it to work.

    Of course, the idiots who made the spanned archives in the first place should be shot!

  28. when i extracting the rar file it is showing that you need to volume to extraction the file and lso please insert the disk to cotinue the extration . pls help me for this proble
    and the file i am trying to extracting is 90 mb. pls send me some good solution for that.

  29. Thanks for that, you’ve been a real help to me. I’ve just changed to Linux recently and the lovely bastard made me cry two times. I’m still keeping it, tho:)

  30. lols I was looking for rar command not unrar but your site came up of the 1st page of google. I was wondering if you a have a guide in compressing not decompressing anyways I’ll just use man rar and check the commands… Cheers

  31. hi,
    my usb was infected by a virus and all my data are in that.
    i try to open it using a win.rar folder and it works for some (not all) of the documents (word) i had in usb.
    but now i want to save them in another file on my pc.
    how can i save files form win.rar to a new folder on my pc?
    thank u

  32. hey
    i hv linux debian
    i hv used another method to install the rar and unrar file i downloaded the file extracted rar and unrar after extracting them i jumped to root terminal the typed
    “cp” dragged the file rar into the root terminal window and then typed “/bin” lastly pressed enter the file was copied to the bin folder(i saw it) i did the same thing with the unrar file and it successfully copied after all this
    i tried extracting the rar file by typing “unrar e” and dragging the file to be extracted into the root terminal window (aftr unrar e the full address of the file appeared) then i pressed enter and then i saw /bin/unrar:cannot execute binary file
    i m very upset about this prob. pls hlp me!

  33. thanks this was helpful
    first i runned
    If any of above, methods is not working for you, download binary package from official rarlab site:
    $ cd /tmp
    $ wget

    Untar file
    $ tar -zxvf rarlinux-3.6.0.tar.gz

    Both unrar and rar commands are located in rar sub-directory. Just go to rar directory:
    $ cd rar
    $ ./unrar

    Now copy rar and unrar to /bin directory:
    # cp rar unrar /bin

    then i changed my default directory to desptop where the file.rar file was and tried to unrar but it did not go right.
    then after reading it above
    i took the file.rar file by copying it to root->temp then shifted the path using cd(change directory command)to tmp (root) and then runned the unrar command it was a success

  34. After I initially commented I clicked the -Notify me when new feedback are added- checkbox and now every time a comment is added I get four emails with the identical comment. Is there any method you may take away me from that service? Thanks!

  35. I’ve followed the instructions for installing, and it works fine for me on RH Linux, but when I try it on Suse Linux on zseries, I get:-
    # unrar e KKPP.U8MBAF0F.D202.NSCC.POS.TMP2.TEMPA.rar
    unrar: unrar: cannot execute [Exec format error]

    Is it not supported on that platform?

  36. Hi, I have a problem. I’m using CentOS 5.8, and I tried this, but I get:

    ./unrar: /lib/ version `GLIBC_2.7′ not found (required by ./unrar)

    How do I install a newer version of GLIBC?


  37. I am getting the following error:
    /usr/bin/unrar e test.rar
    -bash: /usr/bin/unrar: Invalid argument

    i am using Solaris10 platform and the rar file uncompresses perfectly in windows.

    please help.

  38. WinRar 5 and newer has a new “rar5” format option which breaks compatibility with most rar readers (file extension remains the same, to increase confusion…).
    Currently PeaZip seems able to work with new rar5 with an external pluging (that uses non-libre original unrar from RarLab), both on Windows and Linux.
    7-Zip still not supports new format, and consequently neither does p7zip for Linux.

  39. How do I open a Linux Auto Package file on Windows 10???:

    I’m trying to get Mods for my Sims 3 game and some CC but it is not working because all the Mods files and some of the CC are all Linux Auto Package Files and my computer applications will not open it. I used File Viewer Plus and the RAR open app but nothing works! File says the only thing that can open it is Linux. I have searched and I cannot find how to get Linux to open this package file on Windows! PLEASE HELP IT’S DRIVING ME CRAZY!!!!

  40. Hey , pls help

    when i’m running the unrar command like this –> unrar -e Lecture-9.rar
    I’m getting the below error
    bash: /usr/local/bin/unrar: cannot execute binary file

Leave a Comment