<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'm running Ubuntu 16.04. My environment:</p>
<pre><code>(addRetries) factomd $ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/paul/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build188247223=/tmp/go-build -gno-record-gcc-switches"
</code></pre>
<p>CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"</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'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'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'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
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传