如何从CentOS中删除golang软件包

huangapple go评论96阅读模式
英文:

How to remove golang packages from CentOS

问题

如何从CentOS中删除golang软件包。我无法使用"yum remove golang"命令,因为它返回一个无匹配错误。我该如何在CentOS上执行通配符删除以删除下面的所有软件包?

golang.x86_64                           1.6.3-2.el7                    base     
golang-bin.x86_64                       1.6.3-2.el7                    base     
golang-bitbucket-kardianos-osext-devel.noarch
golang-bitbucket-ww-goautoneg-devel.noarch
golang-bitbucket-ww-goautoneg-unit-test.x86_64
golang-cover.x86_64                     0-1.0.hgd32b5854c941.el7       epel     
golang-docs.noarch                      1.6.3-2.el7                    base     
golang-github-codegangsta-cli-devel.noarch
golang-github-coreos-go-log-devel.noarch
golang-github-coreos-go-systemd-devel.noarch
golang-github-cpuguy83-go-md2man.x86_64 1.0.4-2.el7_2                  base     
golang-github-cpuguy83-go-md2man-devel.noarch
golang-github-docopt-docopt-go-devel.noarch
golang-github-fsouza-go-dockerclient-devel.x86_64
golang-github-godbus-dbus-devel.noarch  0-0.1.gitcb98efb.el7.centos    extras   
golang-pkg-linux-386.noarch             1.4.2-1.el7.centos             extras   
golang-pkg-linux-amd64.noarch           1.4.2-1.el7.centos             extras   
golang-pkg-linux-arm.noarch             1.4.2-1.el7.centos             extras   
golang-pkg-netbsd-386.noarch            1.4.2-1.el7.centos             extras   
golang-pkg-netbsd-amd64.noarch          1.4.2-1.el7.centos             extras   
golang-pkg-netbsd-arm.noarch            1.4.2-1.el7.centos             extras   
golang-pkg-openbsd-386.noarch           1.4.2-1.el7.centos             extras   
golang-pkg-openbsd-amd64.noarch         1.4.2-1.el7.centos             extras   
golang-pkg-plan9-386.noarch             1.4.2-1.el7.centos             extras   
golang-pkg-plan9-amd64.noarch           1.4.2-1.el7.centos             extras   
golang-pkg-windows-386.noarch           1.4.2-1.el7.centos             extras   
golang-pkg-windows-amd64.noarch         1.4.2-1.el7.centos             extras   
golang-src.noarch                       1.6.3-2.el7                    base     
golang-tests.noarch                     1.6.3-2.el7                    base     
golang-vet.x86_64                       0-1.0.hgd32b5854c941.el7       epel     
golang-vim.noarch                       1.3.3-2.el7_0                  extras   
英文:

How to remove golang packages from CentOS. I am unable to "yum remove golang" as it returns a no match error. How do I perform wildcard removal on CentOS to remove all the below packages

golang.x86_64                           1.6.3-2.el7                    base     
golang-bin.x86_64                       1.6.3-2.el7                    base     
golang-bitbucket-kardianos-osext-devel.noarch
golang-bitbucket-ww-goautoneg-devel.noarch
golang-bitbucket-ww-goautoneg-unit-test.x86_64
golang-cover.x86_64                     0-1.0.hgd32b5854c941.el7       epel     
golang-docs.noarch                      1.6.3-2.el7                    base     
golang-github-codegangsta-cli-devel.noarch
golang-github-coreos-go-log-devel.noarch
golang-github-coreos-go-systemd-devel.noarch
golang-github-cpuguy83-go-md2man.x86_64 1.0.4-2.el7_2                  base     
golang-github-cpuguy83-go-md2man-devel.noarch
golang-github-docopt-docopt-go-devel.noarch
golang-github-fsouza-go-dockerclient-devel.x86_64
golang-github-godbus-dbus-devel.noarch  0-0.1.gitcb98efb.el7.centos    extras   
golang-pkg-linux-386.noarch             1.4.2-1.el7.centos             extras   
golang-pkg-linux-amd64.noarch           1.4.2-1.el7.centos             extras   
golang-pkg-linux-arm.noarch             1.4.2-1.el7.centos             extras   
golang-pkg-netbsd-386.noarch            1.4.2-1.el7.centos             extras   
golang-pkg-netbsd-amd64.noarch          1.4.2-1.el7.centos             extras   
golang-pkg-netbsd-arm.noarch            1.4.2-1.el7.centos             extras   
golang-pkg-openbsd-386.noarch           1.4.2-1.el7.centos             extras   
golang-pkg-openbsd-amd64.noarch         1.4.2-1.el7.centos             extras   
golang-pkg-plan9-386.noarch             1.4.2-1.el7.centos             extras   
golang-pkg-plan9-amd64.noarch           1.4.2-1.el7.centos             extras   
golang-pkg-windows-386.noarch           1.4.2-1.el7.centos             extras   
golang-pkg-windows-amd64.noarch         1.4.2-1.el7.centos             extras   
golang-src.noarch                       1.6.3-2.el7                    base     
golang-tests.noarch                     1.6.3-2.el7                    base     
golang-vet.x86_64                       0-1.0.hgd32b5854c941.el7       epel     
golang-vim.noarch                       1.3.3-2.el7_0                  extras   

答案1

得分: 9

Golang目前在CentOS上只有1.6.3版本可用。因此,您应该按照这里的描述手动“安装”它。我假设这就是您所做的,因此您还需要手动卸载它。

1. 删除Go二进制文件夹

要找出您安装Go的位置,请运行以下命令:

which go

它将返回Go二进制文件的位置。

接下来,删除Go文件夹(由上述命令返回),例如:

[sudo] rm -rf /usr/local/go

2. 删除环境变量的扩展

最后,您应该删除环境变量的扩展。通常,这是在以下文件之一中完成的:

/etc/profile
~/.profile

删除任何设置GOROOT或扩展PATH环境变量的行,即所有类似于以下内容的行:

export PATH=$PATH:/usr/local/go/bin
export GOROOT=$HOME/go1.X
export PATH=$PATH:$GOROOT/bin
英文:

Golang is currently only available in version 1.6.3 on CentOS. Therefore you should "install" it manually as described here. I assume this is what you did and therefore, you will have to uninstall it manually as well.

1. Remove the Go binary folder

To find out where you installed Go, run

which go

which will return the location of the Go binary.

Next, remove the Go-Folder (as returned by the command above), for example:

[sudo] rm -rf /usr/local/go

2. Remove extension of Environment varialbles

Finally, you should remove the extension of environment variables. Usually this is done in one of the following files

/etc/profile
~/.profile

Remove any line that either sets the GOROOT or extends the PATH environment variable, so everything that looks like this:

export PATH=$PATH:/usr/local/go/bin
export GOROOT=$HOME/go1.X
export PATH=$PATH:$GOROOT/bin

答案2

得分: 2

你可以使用命令"find"删除go目录,然后使用编译源代码安装go,最后在你的环境中设置GOROOT和GOPATH。

英文:

you can delete go directory by command "find",then install go use compile source code,finally set GOROOT and GOPATH in your environment.

答案3

得分: 0

如果你只想删除包,你可以进入Go源代码目录,手动删除packages目录。

如果你不知道你的Go路径在哪里,你可以通过输入go envgo env gopath来获取它。 如何从CentOS中删除golang软件包

英文:

If you only want to remove packages, you can enter the go source directory and remove the packages directory manually.

if you don't know where is your gopath, you can get it by type go env or go env gopath. 如何从CentOS中删除golang软件包

答案4

得分: 0

最好的方法是使用包管理器进行操作。
你可以使用DepGo模块

英文:

The best way is using a package manager to do.
You can use Dep or Go modules

答案5

得分: 0

你不需要做任何事情,因为你的系统上没有安装这些软件包。

你列出的是可用的软件包,而不是已安装的软件包。

如果软件包已安装,第三列中的仓库名称旁边会出现一个@符号。然后你可以将其删除,@符号将消失。

英文:

You don't need to do anything, because none of those packages are installed on your system.

You have listed available packages, not installed packages.

If the package was installed, a @ symbol would appear next to the repository name in the third column. You could then remove it, and the @ would disappear.

huangapple
  • 本文由 发表于 2017年3月22日 10:11:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/42941488.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定