Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
升级Deepin中的Golang失败,求助原因?
Experiences and Insight
897
views ·
5
replies ·
To
floor
Go
thinking2019
deepin
2020-05-19 10:10
Author
一直使用的Deepin 15.11版,最近想学习一下Golang,发现系统默认安装的是Golang 1.10.5版。
从官网下载了最新的1.14版,然后安装,安装完成后,结果通过go version检测发现升级失败。现在百思不得其解,请论坛大侠们给予指点一下。
现在安装完成后是这样的:
Reply
Like 0
Favorite
View the author
All Replies
lcw0268
deepin
2020-05-19 12:26
#1
文件夹带锁,要权限。sudo试试?
Reply
Like 0
View the author
Playhi
deepin
2020-05-19 17:23
#2
v15系统自带了Go嘛,我这没有诶~
如果没有特殊情况(比如必须要Go 1.10.5 才能用的软件),那直接换掉原来路径里(usr/bin/go)的Go的那堆文件就行了,不过我更倾向于把 usr/bin/go 删掉,把新版放在 usr/local/go 用 usr/local/go 里的 go。
不过原文没有写清楚自己装的 go 在哪个文件夹里,楼主的环境情况还是有点迷~
正常的话 按照
https://golang.google.cn/doc/install
写的配置好就没问题了
Reply
Like 0
View the author
sinux
deepin
2020-05-19 19:24
#3
卸载掉原有的golang,按照go的官方文档设置环境变量
Reply
Like 0
View the author
fxbszj
deepin
2020-05-19 19:47
#4
编辑 ~/.bashrc, 添加内容
export GOROOT=/go路径
export PATH=$PATH
GOROOT/bin
保存
source ~/.bashrc
Reply
Like 0
View the author
thinking2019
deepin
2020-05-20 06:10
#5
感谢楼上几位兄弟的帮忙解答,问题解决了。主要原因在于Deepin系统自带golang环境,升级新版本的时候必须要将这个环境的相应golang版本替换掉,具体位置在usr/bin目录里,有“go”和“gofmt”这两个文件,用新版本目录的的最新文件替换掉这两个文件就解决了。现在检查版本和运行测试程序都正常了。非常感谢!
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
WiFi Drivers
Popular Events
More
从官网下载了最新的1.14版,然后安装,安装完成后,结果通过go version检测发现升级失败。现在百思不得其解,请论坛大侠们给予指点一下。
现在安装完成后是这样的: