Installed 1.8.1, now go install fails

agolangf · · 471 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Did all the searches I could think of, so coming here to ask.</p> <p>I installed 1.8.1 via </p> <blockquote> <p>tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz</p> </blockquote> <p>Left all my standard stuff alone (been doing go for a while).</p> <p>Now when I run go install, I get:</p> <blockquote> <p>go install runtime/internal/atomic: open /usr/local/go/pkg/linux_amd64/runtime/internal/atomic.a: permission denied</p> </blockquote> <p>I&#39;m running Ubuntu 16.04. My environment:</p> <pre><code>(addRetries) factomd $ go env GOARCH=&#34;amd64&#34; GOBIN=&#34;&#34; GOEXE=&#34;&#34; GOHOSTARCH=&#34;amd64&#34; GOHOSTOS=&#34;linux&#34; GOOS=&#34;linux&#34; GOPATH=&#34;/home/paul/go&#34; GORACE=&#34;&#34; GOROOT=&#34;/usr/local/go&#34; GOTOOLDIR=&#34;/usr/local/go/pkg/tool/linux_amd64&#34; GCCGO=&#34;gccgo&#34; CC=&#34;gcc&#34; GOGCCFLAGS=&#34;-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build188247223=/tmp/go-build -gno-record-gcc-switches&#34; </code></pre> <p>CXX=&#34;g++&#34; CGO_ENABLED=&#34;1&#34; PKG_CONFIG=&#34;pkg-config&#34; CGO_CFLAGS=&#34;-g -O2&#34; CGO_CPPFLAGS=&#34;&#34; CGO_CXXFLAGS=&#34;-g -O2&#34; CGO_FFLAGS=&#34;-g -O2&#34; CGO_LDFLAGS=&#34;-g -O2&#34;</p> <p>Thanks!</p> <hr/>**评论:**<br/><br/>threemux: <pre><p>Try this:</p> <pre><code>cd $GOPATH rm -rf pkg </code></pre></pre>PaulSnow: <pre><p>Perfect! That fixed it. Thanks!</p></pre>threemux: <pre><p>No problem - this has happened to me several times so glad I could save someone else the trouble!</p></pre>PaulSnow: <pre><p>First for me. Strange, as I&#39;ve been kicking around from 1.2 on...</p></pre>sh41: <pre><blockquote> <p>I installed 1.8.1 via</p> <blockquote> <p>tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz</p> </blockquote> </blockquote> <p>Did you also do <code>rm -rf /usr/local/go</code> before untarring Go 1.8.1? It&#39;s important to do that first, otherwise files from older versions that have been removed in newer versions will stick around and have a chance of causing issues. To have a clean Go setup, you can&#39;t rely on overwriting files only.</p></pre>epiris: <pre><p>Note that command extracted directly on top of your old install, you probably want to mv or rm -rf the old goroot in the future because it could break if files are moved around.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

471 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传