Thursday, October 25, 2012

Unrar ra rar raaah!

/channelling Lady GaGa.  Wow, that was unexpected.

So I needed to 'unrar' an archive...

Do I need to take a step back from that statement?

Fair enough, so 'RAR' is a kind of archive (where you shrink, or 'compress' a file, document, program, etc so that it takes up less space).  Most Windows users will be familiar with ZIP files, well RAR does the same thing, only using a different compression algorithm.

XArchiver is a pretty good front end, and will automatically extract archives using the installed programs.

The only problem is that there is no 'unrar' installed.  Normally I'd just 'apt-get' it, but that didn't work, so here is how:

Step 1: Open the sources.list file in leafpad:
sudo leafpad /etc/apt/sources.list
and add the following line:
deb-src wheezy main contrib non-free rpi
 Then save and close leafpad.

Step 2:  Enter the following into Terminal, in order:
sudo apt-get update
sudo apt-get build-dep unrar-nonfree
sudo apt-get source -b unrar-nonfree
sudo dpkg -i unrar_4.1.4-1_armhf.deb 

Now (once you've rebooted) you should be able to use XArchiver to unrar your archives.  Or you can do it from the command line (in Terminal):
unrar file.rar
(where 'file.rar' is the name of the file you want to unrar).


  1. UnRar source is easily obtainable and buildable on Pi.. now on the other hand.. trying to find the source code for RAR is another story.. We can extract RAR files from command line, but we still can't create them using native RAR command line tools.

    Noticed a few archivers are missing.. LHA is another main one.. now the only available decompressers are wrappers from 3rd party (jlha-utils and lhasa) ..

  2. What's the command used to extract the RAR file? As we tar to extract tar file?