How to extract RAR file in Linux

To install unrar on Ubuntu, run

On Debian 9,

To extract a rar file, run

or