How to install Go on Debian 12? – LinuxWays
Go, which is also known as Golang, stands out as a statically-typed, compiled language famous for its easiness, proficiency, and user-friendly nature in developing high-performance software applications. However, to gain the most out of it, you need to ensure you are using it on an up-to-date system. Debian 12, for example, makes a good choice.
Understanding how to install, verify, and uninstall Go on Debian 12 is a valuable skill, and this article right here will walk you through the entire process. So, let’s begin right away!
Update Your System
An up-to-date system is paramount for the seamless installation of any new software. This includes the latest security patches, system improvements, and other relevant updates.
To update your Debian 12 system, open the terminal and input the given command:
sudo apt update && sudo apt upgrade
Method 1: Installing Go using the APT
It is assumed that you have followed the above command of updating the system. This will also refresh your APT package index. Once this step is done, we can move on to the installation phase. Execute the below command to do so:
Executing this command will ensure that Go, along with all the required dependencies, is installed.
Method 2: Installing Go using the Snap package
Snap is another package manager that operates across a range of Linux distributions and is often favored for its ease of use.
To install Go using Snap, use the following code. Ensure that you have executed the update command prior to this step.
sudo snap install go –channel=1.16/stable –classic
Verify Your Installation
After completing the installation process of Go using either the APT package handling utility or the Snap package manager, it’s crucial to verify that the installation was successful. A simple method to confirm this is by verifying the installed version. In order to do, open the terminal and input:
When you run this command, it will output the version of Go currently installed on your system, which shows you have done it the right way.
Uninstalling Go on Debian 12
There might be circumstances where you need to uninstall Go from your Debian 12 system. Depending on the method you used for installation, the uninstallation process differs:
1: Uninstalling Go installed via APT
If you installed Go using the APT package handling utility, you can uninstall it using the same tool. Use the command:
2: Uninstalling Go installed via Snap
If you used Snap to install Go, you would use the same package manager to uninstall it. Here is the code:
Conclusion
Installing, verifying, and uninstalling Go on Debian 12 is a clear and structured process. Equipped with the right steps and commands, even those relatively new to Debian or Go can ensure that their system is set up for optimal Go development.
Go, with its simplicity and power, coupled with Debian’s stability and security, make for an excellent development environment. It’s now on you to take full benefit.