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

How Do I Completely Uninstall Go from My System?

Susan Sarandon
Release: 2024-12-16 13:51:15
Original
236 people have browsed it

How Do I Completely Uninstall Go from My System?

Uninstalling Go Completely

In this article, we'll delve into the proper procedure to uninstall Go from your system.

The previous solution attempted to resolve a similar issue, but it didn't yield the desired results. As indicated in the question, the command "which go" still returns a path to the Go binary.

Identifying the Installations

It's possible that you installed Go in multiple locations. The output of "which go" suggests that you have Go installed in "/usr/local/go/bin/go." Additionally, you mentioned another installation in a folder named "gocode."

Uninstallation Steps

To successfully uninstall Go, follow these steps:

  • Remove the Go Binary: Delete the "/usr/local/go/" directory containing the Go binary.
  • Remove GOPATH (Optional): If you set a GOPATH environment variable, remove it.
  • Unlink Go from PATH: Remove the "/etc/paths.d/go" file, if it exists.

Alternative Solution (August 2019 Update)

The official Go documentation now provides clear instructions for uninstalling Go. To follow this approach:

  • Run the following commands:

    • sudo rm -rf /usr/local/go
    • sudo rm /etc/paths.d/go
  • Reinstall Go using a package manager like Homebrew:

    • brew install go

This will remove the existing Go installation and install a fresh version in the correct location.

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

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template