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

Mary-Kate Olsen
Release: 2024-11-22 12:12:10
Original
365 people have browsed it

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
Copy after login
  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!

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