Score:0

I cannot rm -rf this directory Permission denied even though I have perm WSL2 ubuntu

la flag

So there is this location ~/.local/share/nvim/mason/.packages for mason to properly install packages it apparently needs to be able to remove stuff within this folder

however my user doesn't have perm to delete this as manually doing rm -rf .packages returns these errors:

rm: cannot remove '.packages/typescript-language-server/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json': Permission denied
rm: cannot remove '.packages/typescript-language-server/node_modules/typescript/lib/lib.es2020.date.d.ts': Permission denied
rm: cannot remove '.packages/typescript-language-server/node_modules/typescript/lib/lib.es2017.object.d.ts': Permission denied
rm: cannot remove '.packages/typescript-language-server/node_modules/typescript/lib/lib.es2023.array.d.ts': Permission denied
rm: cannot remove '.packages/typescript-language-server/node_modules/typescript/lib/lib.webworker.iterable.d.ts': Permission denied
rm: cannot remove '.packages/typescript-language-server/node_modules/typescript/lib/lib.es2015.d.ts': Permission denied
rm: cannot remove '.packages/typescript-language-server/node_modules/typescript/lib/lib.es2017.string.d.ts': Permission denied

however I have used: sudo chown cyneptic:cyneptic .packages - to get perm and the perm shows drwxr-xr-x 7 cyneptic cyneptic 4096 Apr 14 01:32 .

but I can't delete it as cyneptic.

waltinator's pathlld output:

drwxr-xr-x 19 root root 4096 Apr 14 09:42 /
/dev/sdb on / type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
drwxr-xr-x 3 root root 4096 Apr 13 18:02 /home
drwxr-x--- 13 cyneptic cyneptic 4096 Apr 14 09:58 /home/cyneptic
drwx------ 4 cyneptic cyneptic 4096 Apr 13 21:44 /home/cyneptic/.local
drwx------ 3 cyneptic cyneptic 4096 Apr 13 21:44 /home/cyneptic/.local/share
drwx------ 4 cyneptic cyneptic 4096 Apr 14 09:57 /home/cyneptic/.local/share/nvim
drwxr-xr-x 7 cyneptic cyneptic 4096 Apr 14 02:12 /home/cyneptic/.local/share/nvim/mason
drwxr-xr-x 2 cyneptic cyneptic 4096 Apr 14 02:21 /home/cyneptic/.local/share/nvim/mason/.packages
waltinator avatar
it flag
Either the partition is mounted Read-Only, or you don't have Write permission for the parent directory. Explore your Mount/Read/Write/Execute problems with `https://github.com/waltinator/pathlld`, a `bash` script to show the permissions, mount options along the path to an object or objects.
Sombre Dreamer avatar
la flag
edited the output in the original post as it didn't fit in the comments.
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.