Ipfs

IPFS 安裝錯誤

  • July 13, 2019

我正在嘗試在我的 macbook bro 上安裝 IPFS,並按照此處的說明進行操作:

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

當我嘗試執行安裝 bash 腳本時:

./go-ipfs/install.sh

我收到此錯誤:

我們無法在 /usr/local/bin /usr/bin 目錄之一中安裝 ipfs 似乎我們沒有必要的寫入權限。也許嘗試以特權使用者身份執行此腳本:

sudo go-ipfs/install.sh

我也嘗試過使用sudo go-ipfs/install.sh但仍然遇到同樣的錯誤。

從這裡開始的人(https://discuss.ipfs.io/t/we-cannot-install-ipfs-in-one-of-the-directories-usr-local-bin-usr-bin/997)說move ipfs to usr/bin,但是當我嘗試它時,終端返回Operation not permitted

我將不勝感激這方面的幫助

仔細看看 install.sh 腳本,

#!/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

它嘗試寫入BOTH usr/binusr/local/bin. 問題是usr/bin這裡只讀安裝失敗。

我必須將其go-ipfs/ipfs移至usr/local/bin.

現在可以使用

引用自:https://ethereum.stackexchange.com/questions/33928