Open rar file or Extract rar files under Linux or UNIX

by Vivek Gite [Last updated: June 16, 2008]

Q. How do I open rar archive files under Linux / UNIX operating systems?

A. 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.

Under Linux and UNIX, use command called unrar. By default unrar is not being installed on Linux, FreeBSD or UNIX oses. You can install unrar command with the help of apt-get or yum command.
(See below for Windows XP info)

Install unrar command

Under Debian Linux, you need to type apt-get as follows to install unrar program:
# apt-get install unrar

If you are using Fedora core Linux then use yum command as follows (see discussion below):
# yum install unrar

If you are using FreeBSD, use:
# 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 http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz

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

How to use unrar

unrar command supports various options below are common options that you need to use everyday.

Task: To open rar (unpack) file in current directory type command:

$ unrar e file.rar

Please note that replace file.rar filename with your actual filename.

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

(D) To test (t) integrity of archive, file type command:
$ unrar t file.rar


How do I open rar file under Windows XP/NT/2000?

Windows XP or NT/2000 user

  • If you are using Windows XP then I recommend to download Winrar. It is free download ( Free to try License) software.
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 70 comments… read them below or add one }

1 ajos1 02.21.06 at 12:49 am

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

[root@www ~]# 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 nixcraft 02.21.06 at 8:18 am

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:

[dag]
name=Dag RPM Repository for Fedora Core
baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

Save file and import PGP key:
rpm –import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

Upgrade your system by typing following command:
yum update

Install unrar:
yum install unrar

Or just download RPM file from dag site

3 joe 12.27.06 at 4:23 pm

nixcraft - that dag repo is giving a 404:
Setting up repositories
dag [1/4]
http://apt.sw.be/fedora/5/en/i386/dag/repodata/repomd.xml: [Errno 14] HTTP Error 404: Date: Wed, 27 Dec 2006 16:22:50 GMT

4 nixcraft 12.27.06 at 6:00 pm

Joe,

Grab unrar/rar software from http://www.rarlab.com/download.htm install the same. Type the following commands as root user:
cd /tmp
wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
tar -zxvf rarlinux-3.6.0.tar.gz
cd rar
cp rar unrar /bin

Now you can use rar and unrar

5 Eliade 01.02.07 at 1:03 pm

Hi nix, well how to handle *.lzh file on linux?
I want to extract it….

6 nixcraft 01.02.07 at 5:28 pm

Eliade,

Files with .lzh or .lha extensions have been compressed with the LHa, LHarc, or LHx compression utilities. You need to use lha command.

lha x file.lhz

Download link
http://www.infor.kanazawa-it.ac.jp/~ishii/lhaunix/

Hope this helps

7 Ranjan 02.05.07 at 4:19 pm

Thanq.This info is exactly matched my requirement.

8 Arun 02.07.07 at 2:14 pm

hey nixcraft thanks for the info.. :)
really helpful

9 Mike 02.07.07 at 9:17 pm

This is just what I have been looking for, thanks!

10 Daniel 02.26.07 at 12:48 pm

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

unrar: /lib/tls/libc.so.6: 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!

11 nixcraft 02.26.07 at 1:50 pm

Daniel,

What distro you are using? You need to have updated version of GLIBC.

12 pranjal karwal 03.17.07 at 6:20 am

thanks dude it works! thanku for such an easy guide :)

13 AudioTravel 03.29.07 at 12:58 pm

Thanks for this info! Ultimately this forwardet me to:
http://www.webhostingtalk.com/showthread.php?t=542860.
That worked great for me. I think there might be a typo in the posting. I am using Centos Linux, so I thought I’d post what exactly I did:

•wget http://dag.wieers.com/packages/unrar/unrar-3.6.2-1.el4.rf.i386.rpm
•rpm -Uvh unrar-3.6.2-1.el4.rf.i386.rpm
•unrar e rarfile.rar

Cheers,
Richard

14 Alex 04.03.07 at 7:56 am

Thanks nixcraft for your nice guide, worked like a charm.

15 Blind 04.08.07 at 2:11 am

How am i suppose to run these commands? Sorr

16 Margaux 05.24.07 at 9:52 am

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…

Thanks!

17 sleestak 07.19.07 at 4:18 pm

Thanks for providing this info. Very helpful.

18 Ritu 08.02.07 at 10:49 am

cd /tmp
wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
tar -zxvf rarlinux-3.6.0.tar.gz
cd rar
cp rar unrar /bin

but the result is
$ ./unrar
./unrar: /lib/tls/libc.so.6: version `GLIBC_2.4′ not found (required by ./unrar)

can any one tell me what is the problem?

19 Tushar Tandulkar 08.10.07 at 4:40 pm

Very nice help for unrar, thanks

20 Pavan Kumar 08.23.07 at 1:14 pm

Thanks Man.. The Unrar stuff works pretty nice.

21 Vikas 08.29.07 at 8:46 am

Thanks

22 Alex 09.18.07 at 2:38 pm

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.

23 nmuthukumar 09.21.07 at 2:57 pm

Here but it asks password to open the file

24 biswajit deka 09.27.07 at 5:20 am

hi, am using fedora linux and not able to install unrar using yum install unrar
it shows an error as No Match Argument rar.
please help me out of this.

25 Janis 10.10.07 at 5:12 pm

I’ve heard you could also use 7zip to extract RAR files under *nix. That might be easier for some than using the method described in this post.

26 matt 10.11.07 at 9:35 pm

need some help with extracting .rar files on feisty fawn

27 alex 10.15.07 at 6:52 pm

Hey thanks!

28 kldfsj 11.07.07 at 12:29 am

you can use Winrar with WINE - you can decompress and create archives with and without password etc. You will get nag screen in 30 days but it will work further

29 arif 11.18.07 at 9:16 am

apt-get install unrar doesn’t work for debian.
For debian apt-get install unrar-free

Enjoy
Arif Meraj
Unix Administrator
Therapbd

30 Mishu 11.24.07 at 2:36 am

Installation For Suse 10 users:
# su
# yast2 -i unrar

31 doctor mapache 01.03.08 at 8:36 pm

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.

32 Azura 01.10.08 at 3:23 am

Very helpful. I downloaded the binary package and followed the subsequent commands…

It works on Slackware, Yay! ^__^

33 simo 01.25.08 at 10:19 am

Hello when i execute ./rar i got this error

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

any body can provid a help ,

Thanks

34 anand 02.01.08 at 10:47 pm
35 Carmel 02.12.08 at 2:42 pm

If you are searching for a GUI utility to extract and handle rar files with, there is PeaZip for Linux which comes handy:
http://peazip.sourceforge.net/

It runs both in Gnome and in KDE and is available as DEB and RPM.

36 Free Wallpapers 02.16.08 at 3:14 am

Great post!

Thank you!

37 Varaonaid 02.18.08 at 10:06 pm

Carmel…thanks *so* much for the ifno re: peazip. I’m much more comfortable with a GUI and it was exactly was I was looking for. Worked perfectly! :)

38 MSK 02.19.08 at 8:26 am

very useful one..

39 rash 03.14.08 at 8:37 am

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

40 rash 03.14.08 at 9:19 am

I forgot to mention i a am using sidux [debian] live CD!

41 Questioner 03.25.08 at 7:13 pm

How?
file.001
file.002

file.par2

Possible?

42 ilke 04.10.08 at 12:08 pm

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

43 igor 05.12.08 at 3:27 am

cd /tmp
wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
tar -zxvf rarlinux-3.6.0.tar.gz
cd rar
cp rar unrar /bin

when i put the last command it says:
cp: cannot create regular file `/bin/rar’: Permission denied
cp: cannot create regular file `/bin/unrar’: Permission denied

what do i do?

44 vivek 05.12.08 at 8:32 am

igor,

Run last two command as a superuser (root).

45 igor 05.12.08 at 11:28 pm

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.

46 Vladimir 05.13.08 at 6:41 am

run “su -” and enter your root password, then issue your commands and you should receive no errors

47 charlymanja 05.30.08 at 5:52 pm

thanks, it really works on fedora 8, keep blogging

48 Abhishek 06.02.08 at 6:24 am

Thanks!;)

49 vinodh 06.10.08 at 9:02 am

thanks a lot

50 Sergey 06.13.08 at 7:18 pm

# 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 (((

51 celleke 07.10.08 at 7:31 am

Help, all those tools rar, peazip etc are very nice to use. But how can I extract a spawned rar archive?
Called *.rar, *.001 …
Thanks

52 CodeLab 07.19.08 at 12:25 am

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

53 CodeLab 07.19.08 at 12:29 am

@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

54 vivek 07.19.08 at 4:35 am

Try

unrar e -p{password} file.rar
unrar e -pmySecrete demogame.rar

55 bill 07.21.08 at 11:16 am

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

56 DSpider 07.30.08 at 2:47 pm

Same problem on Debian Etch…

unrar: /lib/tls/i686/cmov/libc.so.6: 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…

57 bill 07.31.08 at 6:43 am

Everything is easy as long as you know what you’re doing ;-)
Windows ain’t easy. It’s frightening -> You don’t what what IT does ;-)))

58 S. Nilesh 07.31.08 at 12:31 pm

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.

59 bill 07.31.08 at 12:41 pm

aha, and where to get? googleing for “rar” could be difficult :-D

60 vivek 07.31.08 at 12:55 pm

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
4.0
unrar
If you need further assistance please feel free to use our forum as thread discussion is supported very well..

61 S. Nilesh 07.31.08 at 4:10 pm

Bill,

it is available for Fedora in freshrpms. I don’t about Debian based distros.

62 Vovanuch 08.17.08 at 2:36 am

It works, thanks a lot.
Unrar and 7zip too. I install win-made version of 7zip (it was in my win distr’s collection) under WINE and it works great.

63 shashank 09.10.08 at 7:08 pm

Hey!
Its a very informative site and i am glad i was able to sort the some problems i was facing with the .rar extension.
Thanks a lot
Lambofgod

64 Panik86 09.19.08 at 5:20 am

i have been haveing trouble unzipping a file, i have tried everything, someone plz help me, email is motterboy20@yahoo.com
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 [root@localhost 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.

65 sanzilla 10.08.08 at 5:04 am

the APT method is not working under the debain

#apt-get install unrar

66 Karen 11.05.08 at 2:28 pm

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 Joomla_1.5.7-Stable-Full_Package.zip var/www/Joomla but only get:

mv: cannot move `Joomla_1.5.7-Stable-Full_Package.zip’ to `var/www’: No such file or directory
What am I doing wrong pleaseÉ thanks

67 harshal 11.09.08 at 2:35 pm

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”

68 Madhu R 12.16.08 at 9:13 am

Thankz Wat i want excatlyyyyyyyyy

69 SK 12.20.08 at 4:24 pm

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

can some one help to fix this issue?

i updated glibc

70 Yugi 12.23.08 at 9:02 am

Thanks Dear, Working cool

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , , , , , , , , , , , , , , , , , , , , ,

Previous post: Linux or Unix find and remove files with one find command on fly

Next post: What are the exit statuses of ssh command?