vagrant build fails when chroot_local-packages contains packages
Originally created by @alant on #12374 (Redmine)
Build without custom package works fine. But with a package, it fails with:
P: Configuring file /etc/apt/sources.list
gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: agent_genkey failed: Inappropriate ioctl for device
gpg: key generation failed: Inappropriate ioctl for device
cp: cannot create regular file 'cache/': Not a directory
P: Begin unmounting filesystems...