sudo apt-get install golang git mercurial
which successfully installed version 1.2.1. Unfortunately, when I tried to install drive with:
go get -u github.com/odeke-em/drive/cmd/drive
I encountered this error, and now I see I need at least version 1.4 of Go to make things work. The golang doc says you must first remove the existing version.
So I came across this question that says to simply use:
sudo apt-get purge golang
which gave me this output:
The following packages will be REMOVED: golang* 0 upgraded, 0 newly installed, 1 to remove and 16 not upgraded. After this operation, 92.2 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 263287 files and directories currently installed.) Removing golang (2:1.2.1-2ubuntu1) ...
(no more output after the three dots—just back to the prompt).
But I still see the
go directory in
/usr/lib/, and there's also still a
gopath directory in my home directory.
which I think was created when I did:
$ cat << ! >> ~/.bashrc > export GOPATH=\$HOME/gopath > export PATH=\$GOPATH:\$GOPATH/bin:\$PATH > ! $ source ~/.bashrc # To reload the settings and get the newly set ones # Or open a fresh terminal
during the installation (to create the GOPATH).
So I'm not sure if the uninstall was successful and if it's safe to install a newer version of Go.
Ubuntu 14.04 LTS