dpkg: error processing package oracle-java8-installer (–configure):
it’s so long time since you asked. Because of no answer here, I show you my solution that works well for me.
The root cause of your problem may be from previous java install (it’s not from any repositories, but from manually download package). Thus, you must manually remove post-install scripts, use below commands:
sudo rm /var/lib/dpkg/info/oracle-java8-installer.postinst -f
sudo dpkg --configure oracle-java8-installer