Home  >  Article  >  Backend Development  >  Why Does `go version` Show xgcc Instead of My Installed Go Version?

Why Does `go version` Show xgcc Instead of My Installed Go Version?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-22 12:12:10366browse

Why Does `go version` Show xgcc Instead of My Installed Go Version?

Go Version Not Matching Installed Version

In Go, the go version command displays information about the installed Go version. However, you're encountering an issue where it prints the xgcc version instead of your actual installed version.

To troubleshoot this problem, let's delve into your system configuration.

The provided environment variables indicate that you have a dual installation of Go. One version is installed through the Ubuntu package manager, and the other is installed from the tar version. This explains why you're seeing the xgcc version printed.

Resolving the Issue

To ensure that the correct Go version is printed, you need to remove the gccgo package installed by the Ubuntu package manager.

Steps to Remove gccgo:

  1. Open your terminal window.
  2. Run the following command:
sudo apt-get remove gccgo
  1. Confirm the removal and follow the prompts.

Once gccgo is removed, re-run the go version command to verify that it now displays the correct installed version (1.4.2).

The above is the detailed content of Why Does `go version` Show xgcc Instead of My Installed Go Version?. 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