Home  >  Article  >  Backend Development  >  How to install golang on UOS

How to install golang on UOS

PHPz
PHPzOriginal
2023-04-05 13:50:081260browse

UOS is a Linux-based operating system that uses the lightweight Deepin desktop environment to provide a good user experience and also supports developers. So, how to install golang on UOS? Let’s take a closer look below.

  1. Download golang installation package

Before installing golang, we need to go to the official website to download the corresponding installation package. Before downloading, we need to confirm the architecture of the current UOS system. Here we assume that your UOS system is 64-bit. Then, you can find the corresponding 64-bit binary package on the download page of golang official website. The download address is: https://golang.org/dl/.

  1. Unzip the golang installation package

After the download is completed, we go to the download directory, open the terminal, and execute the following code with administrator rights:

sudo tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz

This command extracts the golang installation package to the /usr/local directory. Here we use go1.17.1 as the installation The name of the package, the same below.

  1. Configuring golang environment variables

After decompression is completed, we need to add the golang binary file directory to the PATH environment variable. Here we can modify /etc/ profile file implementation.

sudo nano /etc/profile

Add the following content at the end of the file:

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

After saving and exiting, execute the following command to make the configuration effective:

source /etc/profile

  1. Test whether the golang installation is successful

Next, We can execute the following command in the terminal to check whether golang has been successfully installed:

go version

If the current installation version information of golang is displayed, it means that golang has been successfully installed.

At this point, the process of installing golang on UOS has been completed. Next, you can happily use golang to develop your programs on UOS!

The above is the detailed content of How to install golang on UOS. 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
Previous article:How to compile golangNext article:How to compile golang