Unable to install ipfs - go

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?

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

Just to make everything clear. Following are the only things you need to do( don't set GOROOT)
Set environment
export PATH=$PATH:/usr/local/go/bin export PATH=$PATH:$GOPATH/bin
Install IPFS from source
$ go get -u -d github.com/ipfs/go-ipfs
$ cd $GOPATH/src/github.com/ipfs/go-ipfs<br>
$ make install

Related

Can't install golangci-lint locally

I'm using RHEL 8.6 and my Go version is the following:
$ go version
go version go1.18.3 linux/amd64
I'm trying to install locally golangci-lint and none of the described ways in the documentation are working.
What I tried:
First:
$ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2
golangci/golangci-lint info checking GitHub for tag 'v1.46.2'
golangci/golangci-lint info found version: 1.46.2 for v1.46.2/linux/amd64
golangci/golangci-lint info installed /home/acabista/go/bin/golangci-lint
$ golangci-lint --version
bash: golangci-lint: command not found...
Second:
$ go install github.com/golangci/golangci-lint/cmd/golangci-lint#v1.46.2
$ golangci-lint --version
bash: golangci-lint: command not found...
Am I missing a step? How can I make this local installation work?
If golang-ci has properly been installed, the issue is most likely that the installation directory is not in your PATH environment variable. Calling golang-ci this way should then work:
${GOPATH}/bin/golangci-lint --version
or
/home/acabista/go/bin/golangci-lint --version
To chek what is happening exactly you can check the content of the GOPATH environment variable. Its content defines where binaries are installed when a go install like command is run.
echo $GOPATH
You need to check also what is the content of the PATH variable, this one defines in which directory the shell looks for binary to execute:
echo $PATH

libssl.so.10: cannot open shared object file: No such file or directory

I am trying to install and use a binary package of a DB software but after setting my environment variables in ~/.profile as following:
export LD_LIBRARY_PATH=/usr/local/DB/lib:$LD_LIBRARY_PATH
export PATH=/usr/local/DB/bin:$PATH
export Data=/path/to/make/db_cluster
I am getting the following error:
libssl.so.10: cannot open shared object file: No such file or directory
Then I used the following instructions:
sudo apt-get update
sudo apt-get install libssl1.0.0 libssl-dev
cd /lib/x86_64-linux-gnu
sudo ln -s libssl.so.1.0.0 libssl.so.10
sudo ln -s libcrypto.so.1.0.0 libcrypto.so.10
but still getting errors regarding it when using for example initdb:
initdb:/lib/x86_64-linux-gnu:libssl.so.10 : versio 'libssl.so.10' not found: (required by home/user/dbfolder/lib/libpq.so.5)
Any help will be appreciate it.
On CentOS 8 the missing lib is included in the compat-openssl10 package, just run:
yum install compat-openssl10
And all works fine...
im in centos,not ubuntu. find libssl.so.10 file first, then cp or ln -s
# whereis libssl.so.10
libssl.so: /usr/lib64/libssl.so.10 /usr/lib64/libssl.so
ln -s /usr/lib64/libssl.so.10 /lib/x86_64-linux-gnu/libssl.so.10
you can look this:
libssl-so-10-cannot-open-shared-object-file-no-such-file-or-directory
libssl.so.10 & libcrypto.so.10 not found
Check the official documentation, use a new system.
Procedure for centos Linux System for the below error:
libssl.so.10: cannot open shared object file: No such file or directory
-Run the command yum provides */libssl*
It will show compatible version library corresponding to your missing library like for libssl.so.10
Install the corresponding package libssl.so.xx by using
yum install libssl.so.xx
In the same way if you get libcrypto.so.10 problem, repeat above steps and replace
libssl with libcrypto
and follow the steps
This will sort out the missing packages problem.

Golang installation

I just followed the installation guide for golang (ubuntu 16).
I extracted the archive at /etc/usr
I added env variable in /home/user/.profile
I just tested a basic go build on the hello world code.
I get the following error:
The program 'go' is currently not installed. You can install it by typing: sudo apt install golang-go
Why does it ask me to install it (again?)?
open the go documentation download
https://go.dev/dl/
choice your os and go version
download then extract the file
extract the file
open the file and open the terminal
6.Add /usr/local/go/bin to the PATH environment variable.
export PATH=$PATH:/usr/local/go/bin
then check the go version
go version
The location of the binary go is not in your path. Ubuntu does not find it and suggests to install it. Add this line to your file /etc/profile, or better $HOME/.profile:
export PATH=$PATH:/usr/local/go/bin
This is documented in the docs: https://golang.org/doc/install#install
If you want to try this solution before editing any files, you can just execute the above command and try to execute the go command in the shell.
There are paths which needs to be set correctly for you go installation to work
GOROOT points to directory where go is installed
export GOROOT=/usr/lib/go
GOPATH points to you workspace directory
export GOPATH=$HOME/go
These paths need to be added in global path variable.
export PATH=$PATH:$GOROOT/bin
You need to put the go executable in your system path. which you can do by
export PATH=$PATH:/etc/usr/go/bin
You can put the same in /home/user/.profile
just use asdf for installation. You can have several version also :D
Docs: https://asdf-vm.com/#/core-manage-asdf
downlaod the installer form enter link description here, choose intaller for linux that suit your device and then you go to your CLI and use wget or curl :
$ wget https://storage.googleapis.com/golang/go1...
and then extract the file to /usr/local :
$ tar -C /usr/local -xzf go1...
add path binary Go to PATH environment variable :
$ echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
$ source ~/.bashrc
and then use go version to check if the Go already installed
If You are using linux then open your terminal and run this command.
sudo apt install golang-go
This command will Install Go lang. in your system. ThankYou
Steps for Go installation:
sudo apt-get update && sudo apt-get -y upgrade    
wget https://dl.google.com/go/go1.17.5.linux-amd64.tar.gz
sudo tar -xvf go1.17.5.linux-amd64.tar.gz
sudo mv go /usr/local/
export GOROOT=/usr/local/go
Add in .bashrc
vi .bashrc
export GOPATH="/root/go"
export GOROOT=/usr/local/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
Download latest version from https://golang.org/doc/install
tar -xzf go1.15.7.linux-amd64.tar.gz
move to /usr/lib/ to folder with version number
sudo mv go /usr/lib/go-1.15
create symkink link on /usr/bin/
ln -s /usr/lib/go-1.15/bin/go /usr/bin/go

go get not installing package k8s-oidc-helper

Unable to install package with go.
I want to install the k8s-oidc-helper package. As per the install guide i had to install go and run the k8s-oidc-helper command. But when i try it, it says command k8s-oidc-helper not found. Below are the commands I tried
sudo apt install golang-go
export $GOPATH=/usr/share/go
sudo -E go get github.com/micahhausler/k8s-oidc-helper
But after this if i try k8s-oidc-helper command it says error command not found.
I assume it is some error with go package
Please make sure that the k8s-oidc-helper is exists in /usr/share/go/bin, and /usr/share/go/bin has been added into PATH environment variable.
Check:
ls /usr/share/go/bin | grep k8s-oidc-helper
echo $PATH | grep /usr/share/go/bin

Installing nyt streamtools: go-bindata: Command not found

I am trying to install nyt streamtools, the open-source project for ETL, but I can't seem to get my go environment right. I'm running Centos 6.5. Compiling from source should be easy, but I keep getting this error when I run the make command:
localhost streamtools]$ make
go get github.com/jteeuwen/go-bindata/...
go-bindata -pkg=server -o st/server/static_bindata.go gui/... examples/...
make: go-bindata: Command not found
make: *** [build/st] Error 127
Any help is greatly appreciated.
Added lines to ~/.bashrc:
export GOPATH="$HOME/go"
PATH="$PATH:$GOPATH/bin"
run
source ~/.bashrc
After setting GOPATH and PATH this did the trick.
For Linux you can also use this:
sudo apt install go-bindata
Windows(from comment by #kundan-roy):
choco install go-bindata
MacOS(from comment by #okan-cetin):
brew install go-bindata

Resources