背景:ubuntu 16.04

安装rar/unrar时提示错误:

sudo apt-get install unrar
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package unrar is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'unrar' has no installation candidate

解决方法:

  1. 打开https://www.rarlab.com/download.htm
  2. 下载RAR 5.71 beta 2 for Linux(根据系统选取32位/64位下载)

如何判断系统是32位/64位: 

root# getconf LONG_BIT
64 # 64位系统

安装:

tar -xzpvf rarlinux-x64-5.7.1b2.tar.gz

cd rar

make

输入make会提示:

root:/home/work/rar# make
mkdir -p /usr/local/bin
mkdir -p /usr/local/lib
cp rar unrar /usr/local/bin
cp rarfiles.lst /etc
cp default.sfx /usr/local/lib