cannot find package “golang.org/x/crypto/curve25519 解决方法
Linux下安装的时候,当执行最后一步命令“make”的时候 报错如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| 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
|
解决方法
报错是在
cannot find package “golang.org/x/crypto/curve25519”
由于某些。。原因,国内使用 go get 安装 golang 官方包会失败
我们必须手工去github下载这些包了。
具体解决方法如下:
到go的安装目录,替换成自己的即可,如果没有可以创建一个
1
| cd /usr/local/go/bin/src/golang.org/x
|
看报错缺什么
第一种

go get gopkg.in/mgo.v2/bson
如果还有其它的包,原理同上,只需要直接去“https://github.com/golang/”这个地址手工克隆下载到本地就可以了。