【问题标题】:"Make install" fails in WSL2 (permission denied)WSL2 中的“进行安装”失败(权限被拒绝)
【发布时间】:2020-11-08 19:01:56
【问题描述】:

我已经在 Windows 10 20H2 上的 WSL2 中设置了我的开发环境。

我已经以与 Linux Mint 相同的方式设置了所有内容,我也在使用它并且没有任何问题。

在 WSL2 上,我可以让“make”命令正常工作(有时它会失败并显示一些权限被拒绝错误,但通常在重启成功后)。但我无法让“make install”命令正常工作。它总是失败。第一次输入“make install”时,我收到一个错误,提示无法访问 tomcat 目录(权限被拒绝)。

另外,我经常被“git clean -fdx”拒绝权限,但有时它会成功:)

现在我收到以下错误:

$ make install
installing git hooks
cp: cannot create regular file '.git/hooks/DPAuthors.pm': Permission denied
cp: cannot create regular file '.git/hooks/DPChecked.pm': Permission denied
cp: cannot create regular file '.git/hooks/DPCommitHooks.pm': Permission denied
cp: cannot create regular file '.git/hooks/DPUsers.pm': Permission denied
make: *** [src/bios/script/Makefile:698: githooksinstall] Error 1

任何提示可能是什么问题?

编辑:现在以 root 身份登录时可以使用。那么如何修复权限以在没有 root 的情况下使用 make 呢?

【问题讨论】:

  • 可能是任何东西,需要信息。这是什么项目? make install 可以做任何事情或什么都不做,这取决于 makefile 中的内容。你把你的项目放在哪里?在与 Windows(和其他服务)共享或 WSL 私有的文件夹中?任何机会makegit 使用 git 和 make (cygwin) 的 windows 安装?

标签: makefile wsl-2


【解决方案1】:

可能与此有关?

I am unable make file or directory in Visual Studio Code in Win Subsystem for Linux

Answer 来自 Uday Pratap Singh

因此 VScode 需要权限。

在您的 WSL 终端上尝试此命令

sudo chown -R username /path/to/working/directory

替换:

'username' 带有您的用户名和目录路径

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-27
    • 2015-10-13
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    相关资源
    最近更新 更多