Uninstall Golang From Linux Ubuntu

Did the golang installation break on your machine and do you need to remove it? This article discusses how to uninstall golang from a Linux ubuntu machine using the command prompt.

Check if Golang is Installed in the System

Before discussing how to uninstall Golang, let us first check if golang is installed on your Linux machine. For this, you can execute the command go version in the terminal as shown below.

check go version
check go version

In the output, you can observe that there is golang installed on the machine. Hence, we will now discuss different ways to uninstall golang from Linux ubuntu.

Uninstall Go from Linux Ubuntu Using Apt

If you have installed Golang using Apt-get, you need to uninstall it using apt only. To uninstall golang from Linux using the Apt command, you can run the following command in the command prompt.

Sudo apt-get remove golang-go

After entering the above command, you will be asked to confirm if you want to remove golang from your machine. If you enter Y, golang will be uninstalled from your machine and you will get the following output. 

uninstall golang using apt
uninstall golang using apt

In the above output, you can observe that golang has been removed from the Ubuntu machine.

To install Ubuntu on your machine after uninstalling it, you can read this article on how to install golang in Linux.

Uninstall Golang in Linux Ubuntu Using snap

If you have installed Golang using Snap store, you need to uninstall it using snap store only. To uninstall go using snap in Linux, you can execute the following command.

sudo snap remove go

After execution of the above command, you will get the following output.

uninstall go using snap
uninstall go using snap

In the above output, you can observe that go has been removed from the machine.

Check if Golang is Removed

To check if the uninstallation process has executed successfully, you can check the golang version using the command go version. If the terminal output says that the command go is not found, the uninstallation process is a success.

verify go removal
verify go removal

In the above image, you can observe that golang has been removed from the system.

Conclusion

In this article, we have discussed different ways to uninstall go in Linux ubuntu.

To learn more about programming, you can read this article on command line arguments using sys.argv in Python. You might also like this article on python SimpleHTTPServer.

I hope you enjoyed reading this article. Stay tuned for more informative articles.

Happy Learning!

Donate to Avid Python

Dear reader,
If you found this article helpful and informative, I would greatly appreciate your support in keeping this blog running by making a donation. Your contributions help us continue creating valuable content for you and others who come across my blog. 
No matter how big or small, every donation is a way of saying "thank you" and shows that you value the time and effort we put into writing these articles. If you feel that our article has provided value to you, We would be grateful for any amount you choose to donate. 
Thank you for your support! 
Best regards, 
Aditya
Founder

If you want to Pay Using UPI, you can also scan the following QR code.

Payment QR Code
Payment QR Code

Leave a Reply