WSL1执行apt相关操作时遭遇权限拒绝问题求助
大家好,我用WSL已经快一年了,最近突然碰到了权限相关的问题,折腾半天没搞定,来求助一下!
刚才我尝试切换到root用户后执行更新并安装jq工具,命令如下:
sudo su apt-get update && apt-get install jq
结果输出报错:
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian bookworm-updates InRelease
Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:4 https://dl.yarnpkg.com/debian stable InRelease
Reading package lists... Done
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
我按照提示执行了修复命令,哪怕已经是root用户,还是报权限拒绝:
sudo dpkg --configure -a
输出:
dpkg: error: error installing new file '/var/lib/dpkg/status': Permission denied
我特意确认了当前用户身份:
whoami
输出:
root
又查看了报错里提到的文件权限和状态:
ls -alh /var/lib/dpkg/status
输出:
-rw-r--r-- 2 root root 0 Jun 26 08:35 /var/lib/dpkg/status
这个文件明明是root所有,大小却变成了0,有没有大佬遇到过类似的问题?求指点解决办法!
备注:内容来源于stack exchange,提问作者Alex

