I recently notice that I got some visitors bump in this coder's talk blog, searching for How to create and extract rar files in linux and I do remember that I didn't put on how to install rar and unrar program in other distributions of linux. I'm so sorry, my mistake.
However, I am a linux supporter and I don't want to make you upset while bumping into this blog and didn't really get what you need. So, here is how to install rar and unrar on other linux distributions...
Under Debian Linux, you can use the same apt-get method as follows to install unrar program:
$ apt-get install unrar
If you are using Fedora core Linux then use yum command as follows:
$ yum install unrar
If you are using FreeBSD, you can use:
$ pkg_add -v -r unrar
If any of above, methods is not working, you can download binary package from official rarlab site and choose the right package for your machine... for example, i chose the latest (by the time i write this post):
$ cd /tmp
$ wget http://www.rarlab.com/rar/rarlinux-3.7.1.tar.gz
then untar the file:
$ tar -zxvf rarlinux-3.7.1.tar.gz
Both rar and unrar commands are located in rar sub-directory. Just go to rar directory:
$ cd rar
Now copy rar and unrar to /bin directory:
$ cp rar unrar /bin
Then you can use the same method on creating and extracting rar files in linux in my previous post.
Another thing to add, you can also test the integrity of archive, with this command:
$ unrar t filename.rar
or list the files inside the rar file using this command:
$ unrar l filename.rar
that's it... hope it helps...