Instructions on how to install the unrar
command on macOS from source.
macOS Command Line Tools need to be installed on your local computer.
To install the Command Line Tools run the following command:
xcode-select --install
To obtain the GNU Tar tool source code run the following commands:
mkdir -p ~/.src/unrar
curl --silent --location --retry 3 "https://www.rarlab.com/rar/unrarsrc-7.1.6.tar.gz" | tar xz --no-same-owner --strip-components=1 -C ~/.src/unrar
cd ~/.src/unrar
No configuration required.
To build the source code run the following command:
make --silent --no-print-directory -f makefile unrar
To install the tool run the following commands:
sudo install -v -m 0755 unrar /usr/local/bin
Run the following command on a terminal window:
unrar
First clean the previous build objects using the following command:
rm -f *.o
To build the libraries run the following command:
make --silent --no-print-directory -f makefile lib
To install the libraries run the following command:
mv libunrar.so libunrar.dylib
sudo install -v libunrar.* /usr/local/lib
After installing the tool you can remove the downloaded source code using the following commands:
cd ~
rm -rf ~/.src