![我无法 rm -rf 此目录权限被拒绝,即使我有权限 WSL2 ubuntu](https://linux22.com/image/951745/%E6%88%91%E6%97%A0%E6%B3%95%20rm%20-rf%20%E6%AD%A4%E7%9B%AE%E2%80%8B%E2%80%8B%E5%BD%95%E6%9D%83%E9%99%90%E8%A2%AB%E6%8B%92%E7%BB%9D%EF%BC%8C%E5%8D%B3%E4%BD%BF%E6%88%91%E6%9C%89%E6%9D%83%E9%99%90%20WSL2%20ubuntu.png)
因此,Mason 有这个位置~/.local/share/nvim/mason/.packages
可以正确安装软件包,显然它需要能够删除此文件夹中的内容
但是我的用户没有权限删除它,因为手动删除rm -rf .packages
会返回以下错误:
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
然而我已经使用过:sudo chown cyneptic:cyneptic .packages
- 来获得烫发,并且烫发显示
drwxr-xr-x 7 cyneptic cyneptic 4096 Apr 14 01:32
。
但我无法将其删除,因为它是恶意的。
waltinator 的 pathlld 输出:
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