Installing rlwrap on linux - without root permission

1.4k views Asked by At

I am trying to install rlwrap. I do not have root permissions.

I did the following to install rlwrap using some steps mentioned online :

gunzip rlwrap*.gz
tar -xvf rlwrap*.tar
cd rlwrap
./configure
make
make check
make install

But in the last step when I do "make install", I get an error

/usr/bin/install: cannot create regular file `/usr/local/bin/rlwrap': Read-only file system
make[2]: *** [install-binPROGRAMS] Error 1

I tried "sudo make install", I still get the same error.

What are the options now to install rlwrap?

Thanks

2

There are 2 answers

0
Alp On BEST ANSWER

In order to install it without root permissions, you need to configure it as follows:

./configure --prefix=$HOME

after which 'make install' will install rlwrap in $HOME/bin

(Above info is from INSTALL file in root folder of rlwrap)

0
Charlie Parker On

Here are the complete instructions. From experience it's always good to make sure you check the official way to install software (even if it's without root) to make sure your not missing anything. This is based on that sanity check.

#!/usr/bin/env bash

# --- Install rlwrap without sudo
# - make sure .local/bin exists
mkdir -p ~/.local/bin/

# - download most recent version of rlwrap -- as of this writing it is 0.46.1 see: https://github.com/hanslub42/rlwrap/releases
cd ~
wget https://github.com/hanslub42/rlwrap/releases/download/0.46.1/rlwrap-0.46.1.tar.gz
# untar rlwrap-0.46.1.tar.gz
tar -xvf rlwrap-0.46.1.tar.gz
cd rlwrap-0.46.1
# - Install rwlwrap without sudo: https://github.com/hanslub42/rlwrap#installation
./configure --prefix=$HOME/.local
make
make install

# - check install (should be the chosen one above)
rlwrap --version

# - clean up
rm -rf ~/rlwrap-0.46.1
rm ~/rlwrap-0.46.1.tar.gz

# - Add .local/bin to path if it's not already there
#export PATH=$PATH:$HOME/.local/bin
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
  echo "Need to put $HOME/.local/bin in path"
#    PATH="$HOME/.local/bin:$PATH"
fi
tr ':' '\n' <<< "$PATH"

works:

(iit_synthesis) brando9~/rlwrap-0.46.1 $ rlwrap --version
rlwrap 0.46.1