How can I extract a multi-part .rar from the terminal/SSH ?

Hi,

I use my Pi as a download/torrent server. I have no display connect, I do everything with SSH and Transmission and Aria2 remotes.

I downloaded a bunch of multi-part .rar, but I would like to extract all the files before sending them to my PC. I searched for a rar extraction software for Debian/Raspberry, but I didn’t find anything really useful, most are discontinued. I would like to be able to do everything from SSH.

Could someone help me for that ? Thanks in advance for any answer. Have a good day.

I believe 7zip has an arm port, and I know if you tell it to unrar the .rar file it will automatically use the .rxx numbers after to fully extract the files

It is called p7zip-full

just do a

sudo apt install p7zip-full

Once installed go into the directory where your compressed files are then

p7zip -d filename.rar

and it should do it’s thing

Recommend to not bork up the torrents use option -dk to leave the original .rar files there until you want to delete them from the swarm

warhawk@M-340C:~$ p7zip --help
Usage: /usr/bin/p7zip [options] [--] [ name ... ]

Options:
    -c --stdout --to-stdout      output data to stdout
    -d --decompress --uncompress decompress file
    -f --force                   do not ask questions
    -k --keep                    keep original file
    -h --help                    print this help
    --                           treat subsequent arguments as file
                                 names, even if they start with a dash

Hi,
Thanks for your answer.

My rar files are named like this ____.part01.rar ____.part02.rar
When I try to execute p7zip on the first part, it tells me :
unknown suffix

What should I do ?

Hi,

did you tried unrar?

https://www.ihaveapc.com/2018/07/how-to-extract-rar-archives-in-debian-stretch/

Thanks for your answer.

unrar works, but apparently it has issues with multi part rar. When I try to extract a part, it doesn’t take the other parts into account. It will correctly unrar the files that are entirely in part01, but if a file is seperated between part01 and part 02, it will fail to extract it. Files that are entirely on other parts doesn’t appear.

We have unrar as a separate install option, which will on Raspbian (our 32-bit RPi images) install the non-free unrar from Debian:

dietpi-software install 170

It has better/wider rar archive support compared to the unrar-free that is shipped with Raspbian, but I have no idea whether it supports multi-part archives or not :thinking:.

Thanks. I just installed Unrar from Dietpi-software. But I didn’t understand how to use it. Just typing unrar [name of my rar file] doesn’t work.

Apprently, the syntax is unrar -<switch 1> - <files…> <@listfiles…> <path_to_extract>
What are switches ? How do I use this syntax ? Could someone give me an example ?

Thanks in advance for any answer.

can you try

unrar e filename.rar

The man page: https://linux.die.net/man/1/unrar

So especially when there is a directory structure included, use unrar x filename.rar command. To extract to a certain directory unrar x filename.rar /path/to/dir/. Exacting only specific files from the archive and the options are mostly not required for what you want, I guress.

Thank you ! It works ! Unrar e correctly extract all the rar taking into account all the parts. Thank you so much !!!
Have a great day and stay safe !

great that it is working now