I don't know why would you like specifically 7-zip's binary to extract RAR, but here we go: To unrar files with Improve this answer. Community Bot 1. Braiam Braiam To extract RAR archives, you'll need to install package "p7zip-rar", too. Install it using : sudo apt-get install p7zip-rar Or you can get it done in single command : sudo apt-get install p7zip p7zip-rar Read p7zip manual for more information: man p7zip.
Pratik Patel Pratik Patel 3 3 silver badges 6 6 bronze badges. Post-bounty note: This was the only answer that correctly mentioned the required package for 7zip to be able to extract rar files. Razor Rassh Razor Rassh 1 1 gold badge 3 3 silver badges 13 13 bronze badges. I didn't come right with the accepted answer. This worked spot-on. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Then again, suggested packages will not be installed unless using --install-suggests option.
The manual page 7z 1 has noted the requirement, as per added bold text :. Second : The subsequent command 7zr from p7zip package does not work with a RAR file. From the sibling manual page 7zr 1 , as per added bold text :. From p7zip on ArchWiki , the difference between 7z, 7za and 7zr binaries has been noted as well. Their manual pages explain the differences:.
Therefore, the only command that works with RAR files is 7z and neither of other two. That is indeed true and I have tested by myself. But that is not all and there is a third, hidden issue. This issue can be reproduced with the newer and older versions of p7zip similarly. Based on the long explanation above, I thought of writing a new answer that will explain to install the correct package, to use the correct command, and to use the correct version and perhaps with actual command output as proof.
That seems easier to do without having to worry whether the suggested edit is appropriate or not, since that will result in much different answer from the original. Then again, there are already 9 answers posted under the question and a new answer will increase that to a two-digit number. That may give a false impression that there are too many similar answers and I may be seen adding more noise under the question. Should I write a new answer for p7zip to open RAR file, or should I just downvote the answer and leave a comment so that more experienced user can do something about it?
I will follow up this again after few days or so. Since you have a question that's slightly more specific than How to open rar file in linux? You could provide a link back to the general "rar" question if you thought it'd be helpful. In your own question, explain what you're trying to do and what the initial problem s were. Then Answer your question with the excellent! I'd recommend using both the rar and the p7zip tags for your question.
First, a little background. Roshal sells a commercial utility for Windows called WinRAR , but also offers uncompress-only clients for a number of operating systems at no charge. Its native format is 7z , which uses a modern offshoot of the LZ77 compression algorithm. Both formats purport to achieve better compression ratios for common data types than older algorithms. They also support splitting large archives into multiple small volumes for easier mobility and error recovery.
The combination of those two features had made them popular choices for online distribution of extremely large files such as ISO images. The 7-Zip app is open source, but remains Windows-only. For Linux users, the project links to a command-line client package named p7zip that provides two executables, 7z and 7za. The two have the same syntax and options, differing only in that 7za is a self-contained app compiled only for use with 7z and the essential Unix formats tar, gzip, bzip2, etc.
The basic syntax is 7z function options filename. To uncompress an archive, use 7z x myfile. You can extract files from an archive with 7z e myotherfile.
0コメント