dongshi1934 2015-10-29 00:19
浏览 38

建筑打包机导致权限被拒绝错误

I am trying to build packer and I am getting this error:

go install golang.org/x/tools/cmd/vet: open /usr/lib/go/pkg/tool/linux_amd64/vet: permission denied
Makefile:40: recipe for target 'test' failed
make: *** [test] Error 1

Is the installer trying to access my /usr folder? Should I run this under root? How can I fix this?

  • 写回答

1条回答 默认 最新

  • dongxie7683 2015-10-29 20:26
    关注

    go vet is special, in that it's a tool that needs to go in GOROOT. In most installations GOROOT is also user writable, but if you installed via a package manager it won't be.

    To work around this, you can do this as root to avoid changing any permissions in your GOPATH:

    GOPATH=/tmp/tmpGOPATH go get golang.org/x/tools/cmd/vet
    rm -rf /tmp/tmpGOPATH
    

    Since vet is a tool provided by the official distribution, not having it installed may be considered a bug in gentoo's go package. The official go binary distribution included the following tools:

    addr2line
    api
    asm
    cgo
    compile
    cover
    dist
    doc
    fix
    link
    nm
    objdump
    pack
    pprof
    tour
    trace
    vet
    yacc
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度