opened
rtsisyk
username_0
Probably `sudo -E -u $USER \$@";`  in generated userwrapper.sh overwrites HOME variable.
warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
issue
created
gdevenyi
username_1
Related?

```
warning: unable to access '/root/.config/git/attributes': Permission denied
```
comment
created
benoit-pierre
username_2
I get some similar issues when using snapcraft, this can be fixed by adding `-H` to the sudo command line:
```diff
diff --git i/packpack w/packpack
index 21bf514..163650b 100755
--- i/packpack
+++ w/packpack
@@ -87,7 +87,7 @@ echo "sudo useradd -u $(id -u) $USER";
 echo "sudo usermod -a -G sudo $USER 2>/dev/null || :";
 echo "sudo usermod -a -G wheel $USER 2>/dev/null || :";
 echo "sudo usermod -a -G adm $USER 2>/dev/null || :";
-echo "sudo -E -u $USER \$@";
+echo "sudo -E -H -u $USER \$@";
 ) > ${BUILDDIR}/userwrapper.sh
 chmod a+x ${BUILDDIR}/userwrapper.sh
```
comment
closed
rtsisyk
username_0
issue