Home >Backend Development >Golang >How to Completely Uninstall Go from My System?

How to Completely Uninstall Go from My System?

Susan Sarandon
Susan SarandonOriginal
2024-12-21 00:06:11678browse

How to Completely Uninstall Go from My System?

Uninstalling Go Completely

Despite trying the suggested solution in a previous thread, you are still able to execute the 'go' command after removing the Go installation. This indicates that there may be residual installations or configurations affecting the availability of Go.

Inspecting your system using 'which go' shows the path '/usr/local/go/bin/go', suggesting that an installation is present in that location. You have already removed the Go code folder and the 'go' executable from that directory.

As for the alternative installation under your GOPATH, you have also removed the designated 'gocode' folder. However, executing 'go' remains possible, raising the question of how to completely uninstall Go on your system.

Official Uninstall Procedure (August 2019 Update)

The official documentation for Go provides clear instructions for uninstallation. Following these steps should resolve your issue:

sudo rm -rf /usr/local/go
sudo rm /etc/paths.d/go

This command will remove the Go installation directory and any associated configuration files.

Ensure that the 'go' command is no longer accessible by verifying its path:

$ which go

If it returns a different location or indicates that 'go' is not found, you have successfully uninstalled Go from your system.

To confirm the completeness of the uninstallation, you can consider reinstalling Go using the package manager (e.g., 'brew install go') and check if the 'go' command is now located in the expected path.

The above is the detailed content of How to Completely Uninstall Go from My System?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn