Well, sorry for the question as it was absolutely my mistake. Thank you for all those who helped me recognize the bug.
The script didn't work as I accidentally used $PATH
as a name for one of my custom variables. It reset the real $PATH
and prevented dpkg execute correctly. Now I corrected it to $TARGET_PATH
and everything works fine. Once again, sorry for being so careless.