Just reproduced this issue on my PC. Somehow solved it by editing /var/lib/dpkg/info/grub-pc.postinst. Changed line 699 by moving "then" keyword onto next line and keeping indentation. After that, runned dpkg- reconfigure and it worked.
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1692183 Title: package grub-pc 2.02~beta2-36ubuntu3.10 failed to install/upgrade: подпроцесс установлен сценарий post-installation возвратил код ошибки 2 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1692183/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs