cannot find package “golang.org/x/crypto/curve25519 解决方法

cannot find package “golang.org/x/crypto/curve25519 解决方法

Linux下安装的时候,当执行最后一步命令“make"的时候 报错如下

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下载这些包了。

具体解决方法如下:

  1. 到go的安装目录,替换成自己的即可,如果没有可以创建一个
cd /usr/local/go/bin/src/golang.org/x 
  1. 看报错缺什么

  2. 第一种
    在这里插入图片描述
    git clone https://github.com/golang/crypto.git

  3. 第二种
    在这里插入图片描述

    go get gopkg.in/mgo.v2/bson

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

发布了46 篇原创文章 · 获赞 12 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/god_zzZ/article/details/102622092