11

I installed go on ubuntu 16.04 from the archive and tried to test my installation by issuing the command go on my terminal. It keeps prompting me / not root-owned 1000:0.

I installed go on /usr/local folder and also included it into my path as instructed on the official golang installation. I removed go and tried to install it again, but found the same result. It sounds more of a linux root permission issue, but I have no clue how to fix it. I tried other commands that I installed from archive and they work perfectly fine. Any kind of help would be appreciated.

eth crypt
  • 277
  • 2
  • 4
  • 10
  • 2
    What do you mean by 'from the archive'? How exactly did you install Go? –  Mar 27 '18 at 06:57
  • 1
    Just a wild guess: there was [this bug](https://github.com/npm/npm/issues/19883) in npm that may have caused this. If it did, there are likely to be more system directories that are no longer owner by root; you should fix that asap as it is a serious security risk. – Peter Mar 27 '18 at 07:48

4 Answers4

15

It seems to complain that the system root directory / has the wrong owner. This is a security problem because you don't want to have regular users changing system files at will. It looks like you changed this on purpose at some point in the past; change it back, or reinstall your system if you have wrecked more permissions than just this one.

sudo chown root /

For the record, the proper way to give yourself limited system access is to use sudo. Add yourself to sudoers (usually this is already set up by the OS installer on any reasonably consumer-oriented Linux distro) and when you need privileges for something, run that command with sudo.

tripleee
  • 175,061
  • 34
  • 275
  • 318
9

Simple, in the command line:

sudo chown root:root /
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
M E S A B O
  • 783
  • 1
  • 11
  • 15
0

In addition to the root permission issue I had, I also found that I installed go using snap to: snap install --classic go, which wasn't a good idea. I was also unable to remove the go folder in /snap, even as root. I now reinstall my system and hopefully the issue will be solved.

eth crypt
  • 277
  • 2
  • 4
  • 10
-3
sudo chown root /var

This will solve your problem