如何从CentOS删除golang软件包

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   
drnvcm3949
drnvcm3949 您无法删除未安装的软件包!
一年多之前 回复
dongzhi5386
dongzhi5386 我认为serverfault是一个更好的地方:)
3 年多之前 回复
douzhushen_9776
douzhushen_9776 看这里
3 年多之前 回复

5个回答



Golang当前仅在CentOS上的版本1.6.3中可用。 因此,您应该按照此处所述手动进行“安装”。 我假设这就是您所做的,因此,您也必须手动将其卸载。</ p>

1。 删除Go二进制文件夹</ strong> </ p>

要找出Go的安装位置,请运行</ p>

 哪个
</ code > </ pre>

,它将返回Go二进制文件的位置。</ p>

下一步,删除Go-Folder(如上述命令返回), 例如:</ p>

  [sudo] rm -rf / usr / local / go 
</ code> </ pre>

2。 删除环境变量的扩展名</ strong> </ p>

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

  /etc/profile
~/.profile
</ code> </ pre>

删除任何设置GOROOT或扩展PATH环境变量的行,因此所有内容如下所示:</ p>

  export PATH = $ PATH:/ usr / local / go /  bin 
export GOROOT = $ HOME / go1.X
export PATH = $ PATH:$ GOROOT / bin
</ code> </ pre>
</ div>

展开原文

原文

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



您可以通过命令“ find”删除go目录,然后使用编译源代码安装go,最后在您的环境中设置GOROOT和GOPATH。 </ p>
</ div>

展开原文

原文

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



如果您只想删除软件包,则可以进入go源目录并手动删除软件包目录。</ p>

如果您不知道gopath在哪里,可以通过键入 go env </ code>或 go env gopath </ code>来获取它。 :)</ p>
</ div>

展开原文

原文

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. :)



最好的方法是使用程序包管理器。
您可以使用 Dep 转到模块</ a> </ p>
</ div>

展开原文

原文

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



您无需执行任何操作,因为这些软件包均未安装在系统上。</ p>

您列出了可用</ em>软件包,而不是已安装</ em>软件包。</ p>

如果已安装软件包,则为 @ < / code>符号将出现在第三列中存储库名称的旁边。 然后,您可以将其删除,然后 @ </ code>就会消失。</ p>
</ div>

展开原文

原文

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.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐