banner
xingli

xingli

猫娘爱好者

Linux Installation Tutorial for Golang

Install golang on Linux

1. Familiarize yourself with common commands#

# Uninstall software
apt-get autoremove package_name 
# Update environment variables
source $HOME/.profile
# Modify environment variables
vim /etc/profile

2. Go installation.#

Select the tab for your computer's operating system below and follow its installation instructions.

Linux Mac Windows

  1. Extract the downloaded archive to /usr/local, creating a Go tree in /usr/local/go.

    Important: This step will remove any previous installation of Go in /usr/local/go before extraction (if any). Please backup all data before proceeding.

    For example, run the following command as root or with sudo:

    rm -rf /usr/local/go && tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz
    
  2. Add /usr/local/go/bin to the PATH environment variable.

    PATH

    You can do this by adding the following line to your $HOME/.profile or /etc/profile (for system-wide installation):

    export PATH=$PATH:/usr/local/go/bin
    

    Note: Changes made to the configuration files may not take effect until you log in to your computer again. To apply the changes immediately, simply run the shell command directly or from a configuration file using a command such as .

    Update environment variables

    source $HOME/.profile
    source /etc/profile
    
  3. Verify that Go is installed by opening a command prompt and typing the following command:

    $ go version
    
  4. Confirm that the command prints the installed Go version.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.