下载

wget https://www.rarlab.com/rar/rarlinux-x64-5.8.0.tar.gz

linux 版 rar 软件不需要安装,直接解压到 /usr/local 下

sudo tar -zxvf rarlinux-x64-5.8.0.tar.gz -C /usr/local
$ ls /usr/local/rar 
acknow.txt   license.txt  order.htm  rarfiles.lst  readme.txt  whatsnew.txt
default.sfx  makefile     rar        rar.txt       unrar

在 /usr/local/bin 下创建软连接

sudo ln -s /usr/local/rar/rar /usr/bin/rar
sudo ln -s /usr/local/rar/unrar /usr//bin/unrar

使用

unrar x 压缩文件.rar /path/to/extract
$ unrar 

UNRAR 5.80 freeware      Copyright (c) 1993-2019 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

......