How to UnRAR files in Linux Command Line


Recently, I had to download some file from the internet. But said file is compressed into .rar.

According to the Debian packages, sudo apt install unrar won’t work anymore because it “is missing, has been obsoleted, or is only available from another source.” I don’t deal with that.

So here’s my workaround. The following assumes you1 have a Debian-like Linux 64-bit distro, and are comfortable with the terminal.

My UnRAR Workaround

  1. Get RAR archiver from RARLAB Archiver. You can either:
    • Go their website, and click on the link that matches your system; or
    • Enter in the terminal:
    curl -LO https://www.rarlab.com/rar/rarlinux-x64-6.0.1.tar.gz
    

    Note that at the time of writing, the current version is 6.0.1. Be sure to check the site for latest updates.

  2. Go to the folder where it got downloaded to. Use tar to extract the files
    tar -xvzf rarlinux-x64-6.0.1.tar.gz
    

    -x option means extracts the file/s from tar
    -v option means verbose, to see the extraction progress
    -z option decompresses all the files within, if any
    -f option indicates the filename you’ll work on

  3. Go into the extracted folder. It should have a Makefile, rar and unrar executables, among other files. Run make like so:
    cd rar/
    sudo make
    

    This will copy the executables to the /usr/local/bin and is now available to the user (you!).

  4. Time to extract the .rar file you got there:
    unrar e legallyDownloadedFile.rar
    

    e option means extract.

That’s it.


  1. I’m actually talking to my future self. This is my notes. ↩︎



Back to Index :: Log :: Projects