DEV Community

Cover image for How to remove golang-go from Debian/Ubuntu/Pop OS using terminal
Bibek Gupta
Bibek Gupta

Posted on

How to remove golang-go from Debian/Ubuntu/Pop OS using terminal

# Uninstall previous golang-go in ubuntu
Enter fullscreen mode Exit fullscreen mode

This command will remove golang-go package

sudo apt-get remove golang-go

Uninstall golang-go and its dependencies using following command

sudo apt-get remove --auto-remove golang-go

Purging your config/data too using following

sudo apt-get purge golang-go or sudo apt-get purge --auto-remove golang-go

# Install Go 1.18.1 in ubuntu
Enter fullscreen mode Exit fullscreen mode

Download the go linux package

wget https://storage.googleapis.com/golang/go1.18.1.linux-amd64.tar.gz

Extract the package using following command

sudo tar -zxvf go1.18.1.linux-amd64.tar.gz -C /usr/local/

Added Go to Path using following commands

echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc

Now run go version command to check whether install or not.

Top comments (0)