Environment Setup2 min read
Solution to “cannot find package golang.org/x/crypto/curve25519”
When running “make” during installation on Linux, the build fails because the golang.org/x/crypto/curve25519 package cannot be found; the package must be downloaded manually from GitHub.
Read in Chinese→Solution to “cannot find package golang.org/x/crypto/curve25519”
When installing on Linux, the following error occurs when running the final “make” command
make
cd cmd/zgrab2 && go build && cd ../..
../../lib/ssh/kex.go:22:2: cannot find package "golang.org/x/crypto/curve25519" in any of:
/usr/local/go/src/golang.org/x/crypto/curve25519 (from $GOROOT)
/usr/local/go/bin/src/golang.org/x/crypto/curve25519 (from $GOPATH)
../../lib/ssh/keys.go:28:2: cannot find package "golang.org/x/crypto/ed25519" in any of:
/usr/local/go/src/golang.org/x/crypto/ed25519 (from $GOROOT)
/usr/local/go/bin/src/golang.org/x/crypto/ed25519 (from $GOPATH)
../../lib/smb/ntlmssp/crypto.go:9:2: cannot find package "golang.org/x/crypto/md4" in any of:
/usr/local/go/src/golang.org/x/crypto/md4 (from $GOROOT)
/usr/local/go/bin/src/golang.org/x/crypto/md4 (from $GOPATH)
../../lib/http/h2_bundle.go:48:2: cannot find package "golang.org/x/net/http/httpguts" in any of:
/usr/local/go/src/golang.org/x/net/http/httpguts (from $GOROOT)
/usr/local/go/bin/src/golang.org/x/net/http/httpguts (from $GOPATH)
../../lib/http/h2_bundle.go:46:2: cannot find package "golang.org/x/net/http2/hpack" in any of:
/usr/local/go/src/golang.org/x/net/http2/hpack (from $GOROOT)
/usr/local/go/bin/src/golang.org/x/net/http2/hpack (from $GOPATH)
../../lib/http/h2_bundle.go:47:2: cannot find package "golang.org/x/net/idna" in any of:
/usr/local/go/src/golang.org/x/net/idna (from $GOROOT)
/usr/local/go/bin/src/golang.org/x/net/idna (from $GOPATH)
../../../../sirupsen/logrus/terminal_check_unix.go:6:8: cannot find package "golang.org/x/sys/unix" in any of:
/usr/local/go/src/golang.org/x/sys/unix (from $GOROOT)
/usr/local/go/bin/src/golang.org/x/sys/unix (from $GOPATH)
../../lib/http/request.go:30:2: cannot find package "golang.org/x/text/unicode/norm" in any of:
/usr/local/go/src/golang.org/x/text/unicode/norm (from $GOROOT)
/usr/local/go/bin/src/golang.org/x/text/unicode/norm (from $GOPATH)
../../lib/http/request.go:31:2: cannot find package "golang.org/x/text/width" in any of:
/usr/local/go/src/golang.org/x/text/width (from $GOROOT)
/usr/local/go/bin/src/golang.org/x/text/width (from $GOPATH)
make: *** [Makefile:24:zgrab2] 错误 1
Solution
The error is:
cannot find package “golang.org/x/crypto/curve25519”
For certain reasons, using go get to install official Golang packages may fail in China.
We have to download these packages manually from GitHub.
The specific solution is as follows:
-
Go to the Go installation directory. Replace it with your own path; if it does not exist, create it.
cd /usr/local/go/bin/src/golang.org/x
```2. Check the error message to see what is missing.
3. First method

`go get gopkg.in/mgo.v2/bson`
If other packages are missing, the same principle applies. Simply go directly to “https://github.com/golang/”这个地址手工克隆下载到本地就可以了。