[WSL] cgo: C compiler 'gcc' not found

When I first time built a Golang project from VS Code wsl mode, I got the below error: Build Error: go build -o /home/oscar/source/github.com/xx/xx/__debug_bin -gcflags all=-N -l . # runtime/cgo cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in $PATH (exit status 2) My first reaction for this error is to install the gcc compiler in my Windows environment. However, the solution is actually to install gcc compiler in the wsl environment. ...

[WSL] Could not access the service hosted in WSL from host by IP

If you just started to use WSL, you may encounter the issue that You only can access your service hosted in the WSL from the host by localhost, but not the IP address. For example, you have a web service that listens to port 8080. In your web browser, you can browse the site with http://localhost:8080, but http://127.0.0.1:8080. The reason is that you need to use the WSL IP address. An easy way to find the address is to execute the below command in WSL terminal. ...

[Wget] Unable to locally verify the issuer's authority

1. Error This issue happens when I run the command wget https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 in my Ubuntu WSL. The completed error looks like below: The extracted error is >> connected. >> ERROR: cannot verify objects.githubusercontent.com's certificate, issued by ‘CN=ospanel’: >> Unable to locally verify the issuer's authority. >> ERROR: certificate common name ‘localhost’ doesn't match requested host name ‘objects.githubusercontent.com’. >> To connect to objects.githubusercontent.com insecurely, use `--no-check-certificate'. You can see there are basically four highlight errors above and many answers for each error if you google them. I had tried the below workarounds in WSL: ...

DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !