Skip to content

Instantly share code, notes, and snippets.

@yamatt
Created December 3, 2023 22:14
Show Gist options
  • Save yamatt/4cb5949829dd3b557a0202b0abbc67ba to your computer and use it in GitHub Desktop.
Save yamatt/4cb5949829dd3b557a0202b0abbc67ba to your computer and use it in GitHub Desktop.
Build and install rar2fs on Ubuntu
#!/bin/bash
# The rar2fs version needs to be a release after the latest unrarsrc version
UNRARVER=5.1.1 # https://ftp.osuosl.org/pub/blfs/conglomeration/unrarsrc/
RAR2FSVER=1.22.0 # https://github.com/hasse69/rar2fs/releases
WORKDIR=`mktemp -d` && cd $WORKDIR
# Get deps
sudo apt-get -q update
sudo apt-get -qy install make libfuse-dev g++
# Get, make and install unrar
wget http://www.rarlab.com/rar/unrarsrc-$UNRARVER.tar.gz
tar zxvf unrarsrc-$UNRARVER.tar.gz
cd unrar
make && sudo make install
make lib && sudo make install-lib
cd ..
# Get, make and install rar2fs
wget https://github.com/hasse69/rar2fs/releases/download/v$RAR2FSVER/rar2fs-$RAR2FSVER.tar.gz
tar zxvf rar2fs-$RAR2FSVER.tar.gz
cd rar2fs-$RAR2FSVER
./configure --with-unrar=../unrar --with-unrar-lib=/usr/lib/
make && sudo make install
# Cleanup
rm -rf $WORKDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment