0

I am trying to install IPFS on my macbook bro with and following instructions from here:

https://ipfs.io/docs/install/#installing-from-a-prebuilt-package

When I try to run the install bash script:

./go-ipfs/install.sh

I get this error:

We cannot install ipfs in one of the directories /usr/local/bin /usr/bin It seems that we do not have the necessary write permissions. Perhaps try running this script as a privileged user:

sudo go-ipfs/install.sh

I have also tried using sudo go-ipfs/install.sh but still run into the same error.

The guys on from here (https://discuss.ipfs.io/t/we-cannot-install-ipfs-in-one-of-the-directories-usr-local-bin-usr-bin/997) say to move ipfs to usr/bin, but when i try it the terminal returns Operation not permitted.

I will appreciate assistance with this

  • I know this is not an answer but, I need to clear my doubt. @Data_Kid, I tried moving to local/bin also but no help. Same problem. I can't comment as I am new here and I require 50 reputation atleast. – Plasmatiger Jan 13 '18 at 10:58
1

Taking a closer look at install.sh script,

#!/bin/sh
#
# Installation script for ipfs. It tries to move $bin in one of the
# directories stored in $binpaths.

bin=ipfs
binpaths="/usr/local/bin /usr/bin"

# This variable contains a nonzero length string in case the script fails
# because of missing write permissions.
is_write_perm_missing=""

for binpath in $binpaths; do
  if mv "$bin" "$binpath/$bin" 2> /dev/null; then
    echo "Moved $bin to $binpath"
    exit 0
  else
    if [ -d "$binpath" -a ! -w "$binpath" ]; then
      is_write_perm_missing=1
    fi
  fi
done

echo "We cannot install $bin in one of the directories $binpaths"

if [ -n "$is_write_perm_missing" ]; then
  echo "It seems that we do not have the necessary write permissions."
  echo "Perhaps try running this script as a privileged user:"
  echo
  echo "    sudo $0"
  echo
fi

exit 1

It tries to write to BOTH usr/bin and usr/local/bin. The issue is that usr/bin is read only here the install was failing.

I have to move the go-ipfs/ipfs to usr/local/bin.

It works nows

0

Just follow the steps mentioned on ipfs.io.

Download tar file from this link and then follow these steps

$ tar xvfz go-ipfs.tar.gz
$ cd go-ipfs
$ ./install.sh

After successful installation you can check your ipfs path using following command

which ipfs

it will print path like this

/usr/local/bin/ipfs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.