from my CSDN: https://blog.csdn.net/su_cicada/article/details/86939944
參考
https://raspberrypi.stackexchange.com/questions/3617/how-to-install-unrar-nonfree
1.卸載unrar-free。
$ sudo apt-get remove unrar-free
2.通過編輯確保您擁有源存儲庫/etc/apt/sources.list。
$ cat /etc/apt/sources.list
# Default repository
deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
# Source repository to add
deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
3.同步apt數據庫。
$ sudo apt-get update
4.創建一個工作目錄並移入其中。該unrar-nonfree命令將在此目錄中構建。
$ cd $(mktemp -d)
5.安裝所需的依賴項unrar-nonfree。
$ sudo apt-get build-dep unrar-nonfree
6.下載unrar-nonfree源代碼並構建.deb軟件包。
$ sudo apt-get source -b unrar-nonfree
7.安裝生成的.deb包。它的名稱取決於版本unrar-nonfree。
$ sudo dpkg -i unrar*.deb
如果第六步報錯如下:
dpkg-buildpackage: info: binary-only upload (no source included)
W: 由於文件'unrar-nonfree_5.3.2-1+deb9u1.dsc'無法被用戶'_apt'訪問,已脫離沙盒並提權為根用戶來進行下載。 - pkgAcquire::Run (13: 權限不夠)
就不要sudo了, 進入root用戶再執行命令試試
