Skip to content

AskAndroids.com

Android Tutorial Station

Unzip rar files in Ubuntu (install unrar)

Sometimes things as simple as unzipping rar files in Ubuntu can be an odyssey unless we have the necessary knowledge or if it is the first time we have Ubuntu. In this article I will comment on several things, the first thing will be to explain how to unzip rar files in Ubuntu. During the process we will have to install the unrar application and for this it will be necessary to take advantage of the Ubuntu multiverse repository that we will talk about taking advantage of this article.

Although the objective of this article is to install unrar in Ubuntu to decompress rar files , it will also serve newcomers to Ubuntu to familiarize themselves with the repositories and the apt package manager (Advanced Packaging Tool). I must also clarify that the installation will be done in Ubuntu 14.04 (Trusty Tahr) using PuTTY and using a cheap VPS for testing.

How to unzip rar files in Ubuntu

In the Ubuntu repositories we find two applications to decompress rar files, one is called unrar-free and the other unrar (the latter some also refer to it as unrar-nonfree ). This seems like a mess, this is because of the licensing issue, while unrar-free is totally free, the unrar-nonfree application is freeware.

I will explain how to install unrar in its freeware version because the unrar-nonfree version fails to decompress files created with WinRar 5. As it is a freeware version, it must be installed through the multiverse repositories of Ubuntu.

The first thing we are going to do is update the package list with the command:
sudo apt-get update

The second step is going to be uninstall unrar-free . We may not have it installed, but to make sure we execute the command:
sudo apt-get remove unrar-free

The third step will be to see that we have the multiverse repository activated. For this we execute the command:
cat /etc/apt/sources.list

And we’ll see the contents of the sources.list file, which should contain something like the following somewhere:

 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse 

These lines may vary a bit, on my server the United States (US) repositories are used, hence the URLs have the prefix us.archive.ubuntu.com , in your case you can see any other location for the repository ( for example uk.archive.ubuntu.com, etc …) but it is something that does not affect us.

If you have these lines in your sources.list file you can skip the next step in which we will explain how to activate the multiverse repositories in Ubuntu.

How to activate multiverse repositories in Ubuntu.

If for some reason you have these repositories disabled, the easiest way to activate them is to paste the following lines in the file /etc/apt/sources.list :

 #Repositorio multiverse Ubuntu 14.04 (Trusty Tahr) deb mirror://mirrors.ubuntu.com/mirrors.txt trusty multiverse deb-src mirror://mirrors.ubuntu.com/mirrors.txt trusty multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates multiverse deb-src mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates multiverse 

As you can see here I don’t use any location for the URLs but I use the address mirror://mirrors.ubuntu.com/mirrors.txt . Using this URL format, what I get is to let the apt package manager itself choose the closest mirror automatically.

How to install unrar in Ubuntu.

Once we have followed the previous steps we proceed to install unrar with the command:
sudo apt-get install unrar

We can already unzip rar files as easily as executing the following command:
unrar e mi_archivo.rar

If we execute the unrar command we get a list of all the options and the version we are using:

 UNRAR 5.00 beta 8 freeware   Copyright (c) 1993-2013 Alexander Roshal  Usage:   unrar <command> -<switch 1> -<switch N> <archive> <files...>         <@listfiles...> <path_to_extract>  <Commands>  e       Extract files without archived paths  l[t[a],b]   List archive contents [technical[all], bare]  p       Print file to stdout  t       Test archive files  v[t[a],b]   Verbosely list archive contents [technical[all],bare]  x       Extract files with full path  <Switches>  -       Stop switches scanning  @[+]     Disable [enable] file lists  ad      Append archive name to destination path  ag[format]  Generate archive name using the current date  ai      Ignore file attributes  ap<path>   Set path inside archive  c-      Disable comments show  cfg-     Disable read configuration  cl      Convert names to lower case  cu      Convert names to upper case  dh      Open shared files  ep      Exclude paths from names  ep3      Expand paths to full including the drive letter  f       Freshen files  id[c,d,p,q]  Disable messages  ierr     Send all messages to stderr  inul     Disable all messages  kb      Keep broken extracted files  n<file>    Additionally filter included files  n@      Read additional filter masks from stdin  n@<list>   Read additional filter masks from list file  o[+|-]    Set the overwrite mode  or      Rename files automatically  ow      Save or restore file owner and group  p[password]  Set password  p-      Do not query password  r       Recurse subdirectories  sl<size>   Process files with size less than specified  sm<size>   Process files with size more than specified  ta<date>   Process files modified after <date> in YYYYMMDDHHMMSS format  tb<date>   Process files modified before <date> in YYYYMMDDHHMMSS format  tn<time>   Process files newer than <time>  to<time>   Process files older than <time>  ts<m,c,a>[N] Save or restore file time (modification, creation, access)  u       Update files  v       List all volumes  ver[n]    File version control  vp      Pause before each volume  x<file>    Exclude specified file  x@      Read file names to exclude from stdin  x@<list>   Exclude files listed in specified list file  y       Assume Yes on all queries 

No comments yet.

Leave a Reply

Your email address will not be published.

Comments (0)