Im trying to install golang and the guide tells me to "Remove any previous Go installation by deleting the /usr/local/go folder (if it exists), then extract the archive you just downloaded into /usr/local, creating a fresh Go tree in /usr/local/go:
$ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz
(You may need to run the command as root or through sudo). "
However when trying to do this it says the directory cant be found. I tried to manually create it but it says i dont have permission. thanks.
Once you sorted this out, make sure that you are running the command in a template or a standalone qube, otherwise the changes won’t persist after a reboot.
edit: I was wrong, AppVM do not inherit /usr/local from a template…
This won’t work for a template since this command is extracting the Go files in /usr/local so this needs to be done in an app qube or in a standalone qube.
$ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz
tar (child): go1.23.2.linux-amd64.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Im assuming you mean run the command in /home/user/Downloads, if so i did that and it says “tar: go: Cannot mkdir: Permission denied
tar: go/test/winbatch.go: Cannot open: No such file or directory
tar: go: Cannot mkdir: Permission denied
tar: go/test/writebarrier.go: Cannot open: No such file or directory
tar: go: Cannot mkdir: Permission denied
tar: go/test/zerodivide.go: Cannot open: No such file or directory
tar: go: Cannot mkdir: Permission denied
tar: go/test/zerosize.go: Cannot open: No such file or directory
tar: Exiting with failure status due to previous errors”
There was many more lines but i just shortened it.
It does if you create the AppVM after the template…and in fact what really happens is whatever is in /usr/local.orig/bin on the template gets copied to /usr/local/bin when the appvm is created (this applies whether or not you’re using the AppVM directly or as a template for disposbles).
This is not very good news if you’re dealing with an AppVM you don’t want to recreate (because it has data on it)–you’ll have to go in and manually adjust /usr/local/bin to have whatever is in /usr/local.orig/bin, but I believe most times a dvm template doesn’t have data on it and can be deleted and recreated without loss.
everytime i try to type go version it says command not found, unless i do “export PATH=$PATH:/usr/local/go/bin” it will then output the version. but whenever i close the terminal go no longer works and i have to do the path again. why is this? i believe it is causing me errors when i try to “build” something from github. it outputs “1: @echo: not found
Building…
file_name: 4: cls: not found”. that is after i do the path thing.
Add it to the $HOME/.profile file to make it persistent as stated in the guide:
Add /usr/local/go/bin to the PATH environment variable.
You can do this by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):
export PATH=$PATH:/usr/local/go/bin
Note: Changes made to a profile file may not apply until the next time you log into your computer. To apply the changes immediately, just run the shell commands directly or execute them from the profile using a command such as source $HOME/.profile.