Score:0

Cannot download files on WSL "Permission Denied" "Cannot write to [...] (Success)"

bm flag

Im trying to install Bazelisk on WSL but when I try to download it typing: "wget https://github.com/bazelbuild/bazelisk/releases/download/v1.15.0/bazelisk-linux-amd64" a message shows up saying "Permission Denied".

enter image description here

I'm following this answer: https://stackoverflow.com/questions/65656165/how-do-you-install-bazel-using-bazelisk

And following this guide to install Mediapipe: https://google.github.io/mediapipe/getting_started/install.html#installing-on-windows-subsystem-for-linux-wsl

hr flag
I can see no reason to be doing this in the /mnt/c/WINDOWS/System32/ directory - change to your WSL user's home directory using `cd` and try the command again
NotTheDr01ds avatar
vn flag
@steeldriver Agreed that it is the problem, but as for "no reason", the problem is that often WSL defaults to it, if the Windows parent process was called from that directory (and many do default to it for one reason or another). So it's an easy, honest mistake to make ... ;-)
NotTheDr01ds avatar
vn flag
And welcome to Ask Ubuntu! As a heads-up, we ask that you don't post text as images. See [here](https://meta.stackoverflow.com/a/285557/11810933) for many reasons why. Thanks!
Score:1
vn flag

As @steeldriver mentioned in the comments, this is due to the fact that you are in the Windows System32 directory when you are attempting the download.

/mnt/c/Windows/System32

maps to the Windows directory:

C:\Windows\System32

This is always a restricted directory on Windows, to avoid system corruption and potential malware, and you would be restricted from downloading to that directory from any Windows application as your default user.

It's recommend that you use the virtual ext4 filesystem that WSL2 provides, which includes your home directory. Simply:

cd ~
# or just cd without any arguments

... to return to your Ubuntu home directory, where you will have permission to download.

Side-note: When starting WSL, the "default" directory is determined by the parent process, which may be the Windows System32 directory in some cases. If you start WSL with wsl ~, then it will always default to your home directory instead.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.