I have problem executing apt-get
If all other options fail, do what i did. other info, i got myself here by trying to install the rpm jdk8 pachage on linux mint 17(ubuntu)
sudo rm -ri /usr/java/
it will ask for password then ask to make sure you want to delete that directory. press "y" and enter/return
then open /var/lib/dpkg/info/ as root and delete any files with "jdk1.8.0-xx.xxxx" once done deleting run
sudo dpkg -r --force-all jdk1.8.0-45
if you are trying to install jdk 8. this page will be of help because it worked for me.(linux mint 17 cinnamon 64bit) http://tecadmin.net/install-oracle-java-8-jdk-8-ubuntu-via-ppa/
Try creating the missing file as suggested here. Follow:
sudo mkdir -p /usr/java
sudo touch /usr/java/aa
sudo touch /usr/sbin/alternatives
sudo apt-get remove jdk1.8.0-40
echo "" | sudo tee /var/lib/dpkg/info/jdk1.8.0-40.postrm
Then un-intall java by:
sudo dpkg --purge --force-all jdk1.8.0-45