To extract rar files with unrar:

sudo apt-get install unrar-free
unrar e file.rar

To extract rar files with 7-zip:

sudo apt-get install p7zip-full
7z x file.rar

e and x mean extract obviously.