While installing Odoo v9 in Ubuntu 16.04 I got this error:
E: Sub-process /usr/bin/dpkg returned an error code (2)
This is not the first time. I got the same error a while ago, I tried this solution: 'How can I fix E: Sub-process /usr/bin/dpkg returned an error code (2)?', but after that I needed to reinstall Ubuntu because of a chown: setuid 0
error. After reinstalling when I again tried to install Odoo v9 it gave me the same error.