Michał Kochanowicz
Michał Kochanowicz

Reputation: 158

"Make install" fails in WSL2 (permission denied)

I have set up my development environment in WSL2 on Windows 10 20H2.

I have set up everything in the same way as on Linux Mint, that I am also using and there are no issues.

On WSL2 I can get "make" command to work (sometimes it fails and shows some permission denied errors, but very often after restart succeeds). But I am not able to get the "make install" command working. It is always failing. The very first time I entered "make install" I got an error about failure to access tomcat directory (permission denied).

Also, very often I get permission denied with "git clean -fdx", but sometimes it succeeds :)

Now I am getting the following errors:

$ 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

Any hints what could be the issue?

EDIT: it worked now when logged in as root. So how can I fix the permissions to be able to use make without root?

Upvotes: 2

Views: 3087

Answers (1)

Tales
Tales

Reputation: 412

Maybe related to this?

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

Answer from Uday Pratap Singh

The VScode needs permissions thus.

Try this command on your WSL terminal

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

Replace :

'username' with your username and the path of your directory

Upvotes: 2

Related Questions