[win10 linux subsystem] dpkg-deb error: control directory has bad permissions 777 (must be >=0755 and <=0775)

打算用win10 linux 子系统来打包ubuntu使用的deb安装包,结果运行dpkg-deb报错:
control directory has bad permissions 777 (must be >=0755 and <=0775)

解决方案:
sudo umount /mnt/e
sudo mount -t drvfs -o uid=1000,gid=1000,umask=022 e: /mnt/e

就是说要重新mount一下,mount的时候就决定了目录权限

[2019-07-06 updated]
按照http://zuyunfei.com/2018/06/15/file-system-configuration-in-wsl/的方法,
在C:\Users\%CurrentUser%\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\etc上建立一个文件,名字叫wsl.conf,内容如下:
[automount]
enabled = true
root = /mnt/
options = “uid=1000,gid=1000,metadata,umask=022”
mountFsTab = false

进入任一目录,打开linux shell,再mount看一下,完美~

 

参考:
https://www.askingbox.com/question/error-message-dpkg-deb-error-control-directory-has-bad-permissions-777
https://www.askingbox.com/question/linux-get-own-user-id-uid-gid
http://zuyunfei.com/2018/06/15/file-system-configuration-in-wsl/

 

发表评论