如何修复“非root所有" [英] how to fix "go not root owned"
问题描述
我从档案文件中安装了ubuntu 16.04,并尝试通过在终端上发出命令 go
来测试我的安装.它不断提示我/不是root拥有的1000:0
.
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
.
我安装了/usr/local
文件夹,并按照golang官方安装说明将其包含在我的路径中.我删除了go并尝试再次安装它,但是发现了相同的结果.听起来更多是linux root权限问题,但是我不知道如何解决它.我尝试了从存档安装的其他命令,它们运行正常.任何帮助将不胜感激.
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.
推荐答案
似乎抱怨系统根目录/
具有错误的所有者.这是一个安全问题,因为您不想让普通用户随意更改系统文件.好像您在过去的某个时刻有意更改了此设置;改回它,或者如果您破坏的权限超过此权限,则重新安装系统.
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 /
出于记录目的,授予自己受限系统访问权限的正确方法是使用 sudo
.将您自己添加到 sudoers
(通常这已由操作系统安装程序在任何面向消费者的合理的Linux发行版上设置),并且在您需要某些特权时,请使用 sudo
.
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
.
这篇关于如何修复“非root所有"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!