[email protected]:~# sudo apt-get purge openjdk-7-* Reading package lists... Done Building dependency tree Reading state information... Done E: The package jre1.8.0-45 needs to be reinstalled, but I can't find an archive for it. [email protected]:~# java -version java version "1.8.0_51" Java(TM) SE Runtime Environment (build 1.8.0_51-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode) [email protected]:~#
I haven't used Debian with java for a while as I mainly use Gentoo but you may have a config issue with the /var/lib/dpkg/info/ which might explain the error. If this is the case, you could remove all entries of version 1.8.0.45 or if there are actual files present in /var/lib/dpkg/info/jdk1.8.0-45 like a prerm/postrm script you could change the -e errexit code or try rebuilding jdk1.8.0.45 from source.
I would still remove all versions of Java installed - ie; java version "1.8.0_51"
I decided come back to this a few days later since I haven't had the time recently.
I don't know if java is still installed or not
[email protected]:/var/lib/dpkg/info# java -version -su: /usr/bin/java: No such file or directory [email protected]:/var/lib/dpkg/info# update-alternatives --config java update-alternatives: error: no alternatives for java [email protected]:/var/lib/dpkg/info#
unfortunately when I tried the commands that you suggested, I only got a return for opened, but due to the same issue, I cannot remove it.
[email protected]:/var/lib/dpkg/info# dpkg --get-selections | awk '/oracle-java/ && /installer/ {print "sudo apt-get purge "$1}' [email protected]:/var/lib/dpkg/info# dpkg --get-selections | awk '/openjdk/ {print "sudo apt-get purge "$1}' sudo apt-get purge openjdk-7-jdk:amd64 sudo apt-get purge openjdk-7-jre:amd64 sudo apt-get purge openjdk-7-jre-headless:amd64 [email protected]:/var/lib/dpkg/info# dpkg --get-selections | awk '/oracle-java/ && /installer/ {system("sudo apt-get purge "$1)}' [email protected]:/var/lib/dpkg/info# dpkg --get-selections | awk '/openjdk/ {system("sudo apt-get purge "$1)}' Reading package lists... Done Building dependency tree Reading state information... Done E: The package jre1.8.0-45 needs to be reinstalled, but I can't find an archive for it. Reading package lists... Done Building dependency tree Reading state information... Done E: The package jre1.8.0-45 needs to be reinstalled, but I can't find an archive for it. Reading package lists... Done Building dependency tree Reading state information... Done E: The package jre1.8.0-45 needs to be reinstalled, but I can't find an archive for it. [email protected]:/var/lib/dpkg/info#
unfortunately I am still unable to install software using apt-get
[email protected]:/var/lib/dpkg/info$ sudo apt-get install oracle-java8-installer Reading package lists... Done Building dependency tree Reading state information... Done E: The package jre1.8.0-45 needs to be reinstalled, but I can't find an archive for it. [email protected]:/var/lib/dpkg/info$
I should have explained how to do this; as I tend to expect an assumed knowledge from linux users. We could have sorted the issue a lot quicker, so my apologies for that.