go get not installing package k8s-oidc-helper - go

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

Related

not solve the error ::protoc-gen-go-grpc: program not found or is not executable

protoc-gen-go-grpc: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1.
not solve the problem for :
ubuntu so please give me the answers
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
and
sudo apt install golang-goprotobuf-dev
and
sudo apt-get protobuf-compiler
You should be able to:
go install github.com/golang/protobuf/protoc-gen-go#latest
Then:
which protoc-gen-go
/${GOPATH}/bin/protoc-gen-go
If you haven't already, execute the following:
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc#latest
This will install protoc-gen-go-grpc executable to the location indicated by $GOBIN (default if not set is $GOPATH/bin)
$ ls $(go env GOPATH)/bin | grep 'protoc-gen-grpc-gateway'
protoc-gen-grpc-gateway
The protoc compiler is looking to run this executable, so you'll need to make sure it is resolvable via your $PATH environment variable.

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

Can't install apertium language packages from source - make command shows errors

I am trying to install apertium-eng-ita package from source (available at https://github.com/apertium/apertium-eng-ita). The system is debian 11 (i tried also on fresh ubuntu, get the same error). So i downloaded all the files into my /root directory (/root/eng-ita contents all the files from provided link) and run:
./autogen.sh
This generated all the necessary files inside the "eng-ita" folder, including "Makefile". But then i run:
make
and see errors like:
apertium-validate-dictionary apertium-eng-ita.eng-ita.dix /bin/bash:
apertium-validate-dictionary: command not found make: ***
[Makefile:769: eng-ita.autobil.bin] Error 127
I began googling (for example, here is some info - https://wiki.apertium.org/wiki/Installation_troubleshooting) this 127 error and found some information about PATH, but where i can put this PATH to make it work?
If you're installing from source, you should first add the apt source and install apertium-all-dev which will give you make etc. Cf. https://wiki.apertium.org/wiki/Prerequisites_for_Debian you should
curl -sS https://apertium.projectjj.com/apt/install-nightly.sh | sudo bash
sudo apt-get -f install locales build-essential automake subversion git pkg-config \
gawk libtool apertium-all-dev
(But you don't need to install from source if you just want to use the pair and not develop for it. There are nightly debian packages of the latest git commit; after running the first command you can get that package with sudo apt install apertium-eng-ita)

Unable to install ipfs

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

MINGW64 "make build" error: "bash: make: command not found"

I am working on Windows 10. I want to run a "make build" in MINGW64 but following error comes up:
$ make build
bash: make: command not found
I want to build Glide for Golang
I tried following:
$ sudo yum install build-essential
bash: sudo: command not found
As well as:
$ yum install build-essential
bash: yum: command not found
And:
$ apt-cyg build-essential
bash: apt-cyg: command not found
How can I "work-around" this problem?
Go to ezwinports, https://sourceforge.net/projects/ezwinports/files/
Download make-4.2.1-without-guile-w32-bin.zip (get the version
without guile)
Extract zip
Copy the contents to C:\ProgramFiles\Git\mingw64\ merging the folders, but do NOT overwrite/replace any exisiting files.
You can also use Chocolatey.
Having it installed, just run:
choco install make
When it finishes, it is installed and available in Git for Bash / MinGW.
You have to install mingw-get and after that you can run mingw-get install msys-make to have the command make available.
Here is a link for what you want http://www.mingw.org/wiki/getting_started
We can't use the 'make' command on windows and we don't get it preinstalled with MINGW. So to use it, you need to download it first. The steps are as follows-
Go to https://sourceforge.net/projects/mingw/postdownload and download it.
After the installation is over, go and check if bin folder is present in the directory of MINGW .
If everything works well till now, change the environment variables- go to settings of your laptop and type Environment variables. Go to it's section and click on 'environment variables' at the end.
On the section where 'path' is written, add a new file - the location of the bin file and save.
Install make by typing the following on mingw command line :
mingw-get install mingw32-make
Now make is installed. To use it in command line just write "mingw32-make" in place of "make".
Try using cmake itself.
In the build directory, run:
cmake --build .
Go to downloads of jmeubank.github.io/tdm/gcc : https://jmeubank.github.io/tdm-gcc/download/
Download 64+32-bit MinGW-w64 edition.
Run the .exe file.
Click on Remove if you have tdm-gcc already.
Then Click on Create to install tdm-gcc.
Complete the installation.
Add path to environment variable if not added automatically.
Now run mingw32-make on your terminal / command prompt.
Hope this works
You have to install make first. Run any of the below commands and it will work.
pip install make
OR
conda install make

Resources