Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I installed unrar-free, but I cannot extract a multi-file .rar archive (my_archive.part01.rar, my_archive.part02.rar, etc.):

$ ls
my_archive.part01.rar
my_archive.part02.rar
my_archive.part03.rar
$ unrar -x my_archive.part01.rar

unrar 0.0.1  Copyright (C) 2004  Ben Asselstine, Jeroen Dekkers


Extracting from /home/morgan/my_archive.part01.rar

Extracting  my_text_file.txt      Failed
1 Failed

I have read that I need unrar-nonfree to manage multipart archives, but It seems it is not included in the official Raspbian repo.

How can I install unrar-nonfree?

share|improve this question
add comment

2 Answers 2

up vote 25 down vote accepted
  1. Uninstall unrar-free.

    $ sudo apt-get remove unrar-free
    
  2. Make sure you have a source repository by editing /etc/apt/sources.list.

    $ cat /etc/apt/sources.list
    # Default repository
    deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
    # Source repository to add
    deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
    
  3. Sync the apt database.

    $ sudo apt-get update
    
  4. Create a working directory and move into it. The unrar-nonfree command will be built in this directory.

    $ mkdir ~/unrar-nonfree && cd ~/unrar-nonfree
    
  5. Install the dependencies required by unrar-nonfree.

    $ sudo apt-get build-dep unrar-nonfree
    
  6. Download the unrar-nonfree sources and build the .deb package.

    $ sudo apt-get source -b unrar-nonfree
    
  7. Install the generated .deb package. Its name varies depending on the version of unrar-nonfree.

    $ sudo dpkg -i unrar*.deb
    
  8. You can remove the working directory you created in 4..

    $ cd && rm -r ~/unrar-nonfree
    

Once installed, you can use either unrar or unrar-nonfree (unrar is a simlink to unrar-nonfree).

Warning: unrar-nonfree and unrar-free options are different. For instance, to extract an archive:

$ # with unrar-free
$ unrar -x my_archive.part01.rar

$ # with unrar-nonfree
$ unrar e my_archive.part01.rar

Please man unrar-nonfree for more details.

share|improve this answer
    
This is a small correction to Morgan's excellent answer. Step 7 should be this: $ sudo dpkg -i unrar_4.1.4-1_armhf.deb Other than this, it's a perfect solution. Tim –  user3413 Nov 24 '12 at 5:53
    
Turned step #7 into sudo dpkg -i unrar*.deb so it doesn't depend on version number anymore. –  Marius Butuc Aug 25 '13 at 1:18
add comment

this is my compiled unrar 4.20

unrar_4.20_armhf.deb

eliafino

share|improve this answer
8  
Hi there. This answer will only stay relevant for a short period of time (until unrar) is updated. We usually like answers to be able to stand on their own, which is why teaching how to compile the package is better. –  Jivings Nov 22 '12 at 6:41
    
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  berry120 Jan 24 '13 at 16:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.