I want to upgrade my go to the latest version. But before installing the new version I must delete the existing one. My OS is Ubuntu 18.04. So I run
rm -rf /usr/local/go but the answer I get is:
rm: cannot remove 'go': Permission denied.
I have changed the directory permissions with
sudo chmod -R 777 go, but the result is the same.
What do you recommend?
June 25, 2020, 8:47am
But only if you are really sure that the folder is not “owned” by a package you installed.
/usr/local/go/ folder be owned by a installed package?
June 25, 2020, 8:55am
If you did
apt-get install foo and it therefore installed a package that contained that folder.
Not owned in the filesystem sense of it, but “owned” in the context of your package manager.
As far as I can remember, I installed go by downloading the archive and extracting it into
June 25, 2020, 9:01am
Then it should be safe to remove it, without confusing your package managers database.
As far as I remember thats even the proposed location of the installation guide on
golang.org. I’m not a huge fan of that practice.
June 25, 2020, 11:23am
What would you recommend?
June 25, 2020, 11:42am
Using properly packaged software or install in the users home.
September 23, 2020, 11:42am
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.