I have a Debian package with postinst script in it that create symlinks. When I try to install the .deb package with --root (since I want to change the location where the package should be installed), I get this error:
dpkg (subprocess): unable to execute installed post-installation script: No such file or directory
subprocess installed post-installation script returned error exit status 2
dpkg is trying to find the postinst script in /var/lib/dpkg/info. What I can't understand is that according to the dpkg man page, using --root option changes the admindir to newdir/var/lib/dpkg as well.Then why is it trying to find postinst script in /var/lib/dpkg/info/?
I tried creating another package that doesn't contain this maintainer script and installed it using the same -i --root=newdir option and that doesn't throw any error.
Please let me know how I can make this work.