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.
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/.
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.
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
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!