无法安装IPFS。

huangapple go评论81阅读模式
英文:

Unable to install ipfs

问题

我正在尝试在Ubuntu上下载ipfs,以便与golang一起使用。

我使用以下命令:

go get -d github.com/ipfs/go-ipfs

但是这给我返回以下错误信息:

package github.com/ipfs/go-ipfs
	imports runtime: cannot find package "runtime" in any of:
	/home/userone/go/src/runtime (from $GOROOT)
	/home/userone/gostuff/src/runtime (from $GOPATH)

我在文件~/.bashrc的末尾添加了以下行:

export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

我正在使用Ubuntu 16.04,并使用以下命令安装了golang:

sudo aptitude install golang-go git

为什么会出现这个错误信息?

英文:

I'm trying to download ipfs on ubuntu so I can use it with golang.

I'm using the following command:

go get -d github.com/ipfs/go-ipfs

But that gives me the following error message:

package github.com/ipfs/go-ipfs
	imports runtime: cannot find package "runtime" in any of:
	/home/userone/go/src/runtime (from $GOROOT)
	/home/userone/gostuff/src/runtime (from $GOPATH)

I have added the following lines at the end of the file ~/.bashrc

export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

I am using Ubuntu 16.04 and I installed golang using the following command

sudo aptitude install golang-go git

Why am I getting that error message?

答案1

得分: 1

安装说明可以在README.md中找到,链接为https://github.com/ipfs/go-ipfs#install

要从源代码编译,请执行以下操作:

$ go get -u -d github.com/ipfs/go-ipfs

$ cd $GOPATH/src/github.com/ipfs/go-ipfs
$ make install
英文:

Install instructions can be found at the README.md https://github.com/ipfs/go-ipfs#install

To compile from source, do:

  $ go get -u -d github.com/ipfs/go-ipfs

  $ cd $GOPATH/src/github.com/ipfs/go-ipfs
  $ make install

答案2

得分: 1

只需澄清一切。以下是你需要做的唯一事情(不要设置GOROOT):

  1. 设置环境

export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$GOPATH/bin

  1. 从源代码安装IPFS

$ go get -u -d github.com/ipfs/go-ipfs

$ cd $GOPATH/src/github.com/ipfs/go-ipfs
$ make install

英文:

Just to make everything clear. Following are the only things you need to do( don't set GOROOT)

  1. Set environment

> export PATH=$PATH:/usr/local/go/bin<br> export PATH=$PATH:$GOPATH/bin

  1. Install IPFS from source

> $ go get -u -d github.com/ipfs/go-ipfs
>
> $ cd $GOPATH/src/github.com/ipfs/go-ipfs<br>
> $ make install

huangapple
  • 本文由 发表于 2017年3月16日 05:20:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/42820880.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定