# Uninstall previous golang-go in ubuntu
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
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
Top comments (0)