Install golang
The first thing is to install golang. Here I use the downloading package to install. This will make sure you will install the latest version of golang. You can also choose the “apt-get install golang-go” command but I’m not sure if it’s the latest version.
Download the latest golang package file from here. Then run the following command to extract the files to your “/usr/local/go” directory.
1 | # "tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz" |
Make sure you have the following lines in your “/.bashrc” or “/.zshrc” file.
1 | # Set your "$GOPATH" environment variable. |
Install “ipfs-update” and “ipfs”
“ipfs-update” is a command-line tool to install and upgrade the “ipfs” binary.
1 | # Install "ipfs-update". |
gx
“gx“ is a pacakge mananger for “golang” based on “ipfs”.
1 | # Install. |
Summary
Download the “golang” package, extract it to “/usr/local” directory, add the “/usr/local/go/bin” to “$PATH”, as well as defining “$GOPATH” and adding “$GOPATH/bin” to “$PATH”, then “go” is ready to be used.
Install “ipfs-update” package by the “go get -u github.com/ipfs/ipfs-update” command, then install “ipfs” by the “ipfs-update install latest”, run “ipfs init”, then “ipfs” is ready.