我已经安装了此版本的 go:
$ go version
go version go1.10.3 linux/amd64
我的资料来源列表包含:
$ cat /etc/apt/sources.list.d/gophers-ubuntu-archive-bionic.list
deb http://ppa.launchpad.net/gophers/archive/ubuntu bionic main
# deb-src http://ppa.launchpad.net/gophers/archive/ubuntu bionic main
当我进行任何包更新时,我会看到:
The following packages will be upgraded:
golang-1.10-go
After this operation, 17.4 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 377323 files and directories currently installed.)
Preparing to unpack .../golang-1.10-go_1.10.4-2ubuntu1~18.04.1_amd64.deb ...
Unpacking golang-1.10-go (1.10.4-2ubuntu1~18.04.1) over (1.10.1-1ubuntu2) ...
dpkg: error processing archive /var/cache/apt/archives/golang-1.10-go_1.10.4-2ubuntu1~18.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/go-1.10/src', which is also in package golang-1.10-race-detector-runtime 0.0+svn285455-0ubuntu1
Errors were encountered while processing:
/var/cache/apt/archives/golang-1.10-go_1.10.4-2ubuntu1~18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
出了什么问题,配置有什么错误,我该如何使更新成功?
答案1
删除包:
sudo apt-get remove golang-go
删除依赖:
sudo apt-get remove --auto-remove golang-go
删除数据和配置:
sudo apt-get purge golang-go
然后按照安装说明进行操作golang 社区