cgo: exec gcc: exec: "gcc": executable file not found in $PATH Error in Egress operator installation

solveit

I am trying Egress Operator for restricting the egress calls based on domain. I am using Ubuntu 18 Hyper-V VM and I have all prerequisites:

  1. Azure repository to push images
  2. Kubebuilder for code generation
  3. Kustomize for building the Kubernetes manifests
  4. CoreDns (default with k3s) pod running
  5. Golang : go version go1.16.5 linux/amd64

But while Testing locally make run is giving below error:

root@Ubuntu18-Virtual-Machine:~/egress-operator# make run
go: creating new go.mod: module tmp
go get: added sigs.k8s.io/controller-tools v0.2.4
/root/go/bin/controller-gen object:headerFile=./hack/boilerplate.go.txt paths="./..."
Error: go [list -e -json -compiled=true -test=false -export=false -deps=true -find=false -tags ignore_autogenerated -- ./...]: exit status 2: # runtime/cgo
cgo: exec gcc: exec: "gcc": executable file not found in $PATH

Also after editing coredns deployment and coredns Corefile in ConfigMap, as mentioned in coredns plugin setup I am seeing blow error while executing make deploy command:

root@Ubuntu18-Virtual-Machine:~/egress-operator# make deploy IMG=MY_REPO/egress-operator:v0.1
go: creating new go.mod: module tmp
go get: added sigs.k8s.io/controller-tools v0.2.4
/root/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
Error: go [list -e -json -compiled=true -test=false -export=false -deps=true -find=false -tags ignore_autogenerated -- ./...]: exit status 2: # runtime/cgo
cgo: exec gcc: exec: "gcc": executable file not found in $PATH

Can someone let me know how to resolve this ?

Mikołaj Głodziak

It looks like your environment doesn't have the gcc compiler installed. Please try this as follows:

sudo apt-get install build-essential

or

sudo apt-get  build-dep  gcc

Then check if the installation is successful:

gcc --version

See also this similar problem.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

gcloud app deploy says: exec: "git": executable file not found in $PATH

starting container process caused "exec: > \"exec\": executable file not found in $PATH": unknown

Golang docker multi-stage build failing to run: exec: "go": executable file not found in $PATH

"exec: \"go\": executable file not found in $PATH"

exec: "gcc": executable file not found in %PATH% when trying go build

exec: executable file not found in $PATH

exec: "sqlboiler": executable file not found in $PATH

Go moq : running "moq": exec: "moq": executable file not found in $PATH

godep: exec: "go": executable file not found in $PATH

docker-exec failed: "cd": executable file not found in $PATH

exec: "com.docker.cli": executable file not found in $PATH

System error: exec: "deployment": executable file not found in $PATH

exec: "docker-runc": executable file not found in $PATH: unknown

"sqlplus": executable file not found in $PATH" when running a command with docker exec

Getting error executable file not found in $PATH when trying verbose run docker container or when docker exec

linux x86_64 vm gcc error in architecture of executable output, exec file format error

Error running docker container: starting container process caused "exec: \"python\": executable file not found in $PATH": unknown

gcc without full path: error trying to exec 'cc1': execvp: No such file or directory

"exec: "python": executable file not found in $PATH

Docker container build faild: "exec: \"flask\": executable file not found in $PATH": unknown

docker local registry "exec: \"htpasswd\": executable file not found in $PATH"

exec: "php-fpm": executable file not found in $PATH: unknown

Docker Base Simple image : Cannot start container XXX: exec: "cat": executable file not found in $PATH

Compiling Torch on Ubuntu 17.04: No Support for GCC version >5 and Gcc error: gcc: error trying to exec 'cc1': execvp: No such file or directory

CloudFoundry staging error exec: "git": executable file not found in $PATH

How to solve "exec: \"Python\": executable file not found in $PATH": unknown. for simple python script on AWS

Docker Go image: starting container process caused: exec: "app": executable file not found in $PATH: unknown

Error: exec: \"app.handler\": executable file not found in $PATH", "errorType": "Runtime.InvalidEntrypoint"

Docker Error: OCI runtime create failed: runc create failed: unable to start container process: exec: ".": executable file not found in $PATH: unknown