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


When I try to run the install bash script:


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. Commented Jan 13, 2018 at 10:58

2 Answers 2


Taking a closer look at install.sh script,

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

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

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

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

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 "    sudo $0"

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


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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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