Extract Multi-Part rar Files In Ubuntu

Today’s article is limited to just a subset of users as there aren’t that many people who want to extract multi-part rar files in Ubuntu. This isn’t something you’re going to face often (unless you’re still pirating stuff from Usenet) but it’s something some folks will face. So, this article is for all of those people, all three of you!

I suppose we first need to talk about WinRAR. For those that do not know, WinRAR is a proprietary company that uses a proprietary compression method. Even though it’s proprietary, it has some pretty great features. You have to give credit where credit is due. There are multiple versions of compression used over the years but they all share the same .rar file extension and are all reasonably compatible with one another.

The GUI version of WinRAR is a Windows-only trialware application but there’s a command-line version that can be installed in most distros. While this article is Ubuntu-specific, it’s sure to work with other distros though the installation method may be different. On top of that, many Linux tools (such as file-roller) are capable of extracting files compressed with WinRAR.

This isn’t going to be a very complicated article. It also shouldn’t be all that difficult. I figure folks can follow along if they need to when they need to. This isn’t something the average Linux user is going to face daily. After all, the majority of our software is free! There’s no reason to pirate it! (Seriously, I’m sure there are legitimate uses for multi-part rar files but I’ve only really seen them in frequent use with software piracy.)

Install unrar In Ubuntu:

To extract these multi-part rar files in Ubuntu, you’ll want to install the unrar application. That makes sense, after all. So, like so many things, we’re going to do this in the terminal. You can certainly install unrar with the GUI software installation tools, but we might as well do so in the terminal.

With that in mind, and with this unrar process also being in the terminal, we might as well go ahead and get unrar installed in Ubuntu. First, you can press CTRL + ALT + T to open your terminal. You should also be aware that this is going to pretty much work with any Debian (or Ubuntu) derivative out there. So, this works just as well with Mint, ElementaryOS, or the like…

I suppose we should update first, and you can do that easily enough:

If you trust your upgrades and don’t want to have to manually approve them, then you can just add the -y flag to the end of that, like so:

The next step is going to be installing unrar. You do so like this:

At this point, you can check the man page (man unrar) where you’ll learn that the unrar application describes itself like so:

unrar – extract files from rar archives

That’s a good description and, as you can see, is exactly the tool we want for this operation. If you’re going to extract multi-part rar files in Ubuntu, this is a good tool to do it with. (You can just as easily find a GUI application that will take care of this.)

Extract Multi-Part rar Files In Ubuntu:

I hope you left your terminal open after the installation phase. If not, you’re going to need to open it again. I envision people searching for this specific process and following along. I don’t envision people doing this just for the sake of following along. After all, it’s not like I made multiple-part rar files for you to test this with. You’ll want this article when you need this article.

Anyhow, the process is quite simple.

First, move all of the files into a single directory. This is going to make it much easier. In theory, you could specify the individual paths, but we’re not going to be doing that. No, move all the multiple parts to a single directory. Trust me on this one.

The syntax you’re going to use will be as follows:

No,  you do not include all the other parts. You only need to unrar the first file and the unrar tool will realize that it’s multiple parts and extract them sequentially. It will even tell you that it’s doing so, as it writes that data to the standard output.

This is why you move all the files to their own directory. Again, you only need to tell unrar to extract the very first of the files. It’ll happily find and extract the rest. Of course, you need ownership of the files or you’ll need elevated permissions (such as sudo) to extract the files.

Closure:

So, if you ever need to extract multi-part rar files in Ubuntu, you now know there’s an article that covers this. I don’t expect all that many people to need this information. I do anticipate those who need this information will be able to find this site (or another, I suppose) through a search engine. This isn’t something you’re likely to need every day, even though it’s relatively simple.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Extract An .rar File

Today, we’re going to learn how to extract an .rar file in Linux. You don’t see .rar files all that often with Linux, but sometimes they crop up. Today’s article will explain how to extract them.

You may recall .rar files from your Windows days, assuming you have a history with Windows – as many of us Linux users do. You’d probably be most familiar with the application known as ‘WinRAR‘. 

While the application is specifically for Windows (there’s a text-based WinRAR for Linux, perhaps a subject for another article), it produces files compressed with the .rar format. The .rar compression is much like any other compression, from .tar.gz to .zip. At some point, you may be faced with opening one while you’re using Linux.

Just because the files are often made with WinRAR doesn’t mean the files will only be opened in Windows. Once in a while, you’ll find something you need that’s in .rar format and you’re using Linux. Well, fear not, you can extract an .rar file easily enough. It’s just a simple terminal command away and you should be all set. While not a skill you’ll need often, it’s one you’ll maybe need and now is a good enough time to learn how.

Extract An .RAR File:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Once you have the terminal open, you’ll need to install an application called ‘unrar’. If you’re using a major distro, it’s likely in your repository – though maybe under the name of ‘unrar-nonfree’. Search your repositories and you’ll find it.

If you’re using Debian/Ubuntu/similar then it’s easy enough – it’s called ‘unrar’ and you install it with:

With that installed, the next part is really quite easy:

That will extract the contents of the .rar file while preserving paths. If you don’t care about that sort of result, just use the ‘e’ flag like this (and it’ll extract everything to the current directory):

You can also extract password protected content easily enough, just read the man pages with man unrar to learn how. Anything you can do with a GUI you can do with the terminal. You just need to read the man page. This article only covers how to extract an .rar file without any complexity.

Closure:

That’s it. That’s today’s article. The goal was to learn how to extract an .rar file in Linux and now you know how to do so with unrar and the Linux terminal. ‘Snot all that complicated, really.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.