1

I want to remove the oracle-java8-installer but it gives the below errors. Perhaps good to mention that I messed a bit with apt, e.g. at some point I manually removed the apt cache (but the java problem existed already and I do not think it has gotten worse).

~$ sudo apt-get remove --purge oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  oracle-java8-installer*
0 to upgrade, 0 to newly install, 1 to remove and 25 not to upgrade.
1 not fully installed or removed.
After this operation, 129 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 693990 files and directories currently installed.)
Removing oracle-java8-installer (8u45+8u33arm-1~webupd8~1) ...
update-alternatives: warning: alternative /usr/lib/jvm/java-7-oracle/bin/javafxpackager (part of link group javafxpackager) doesn't exist; removing from list of alternatives
update-alternatives: error: unable to read link `/etc/alternatives/javafxpackager': Invalid argument
dpkg: error processing package oracle-java8-installer (--purge):
 subprocess installed pre-removal script returned error exit status 2
Installing from local file /var/cache/oracle-jdk8-installer/jdk-8u45-linux-x64.tar.gz
Removing outdated cached downloads...
mv: cannot move ‘jdk1.8.0_45’ to ‘java-8-oracle/jdk1.8.0_45’: Directory not empty
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here are the last lines of my dpkg log:

2015-07-28 22:14:14 startup packages purge
2015-07-28 22:14:14 status half-configured oracle-java8-installer:all 8u45+8u33arm-1~webupd8~1
2015-07-28 22:14:15 remove oracle-java8-installer:all 8u45+8u33arm-1~webupd8~1 <none>
2015-07-28 22:14:15 status half-configured oracle-java8-installer:all 8u45+8u33arm-1~webupd8~1

How can I get Java working again?

2 Answers 2

1

Simply remove the folder

sudo rm -r /usr/lib/jvm/java-8-oracle/jdk1.8.0_45

Still more you can not break. ;)

Now purge it again

sudo apt-get purge java-oracle8-installer

After that, install it again via the outdated PPA or the script in @Pilot6 answer.

3
  • I am afraid the outdated ppa will not install, since it will not be able to download. My script does not need that deb. It should work, if I did not make a stupid mistake in the last revision.
    – Pilot6
    Jul 28, 2015 at 20:59
  • @Pilot6 is the PPA dead?
    – A.B.
    Jul 28, 2015 at 21:08
  • I do not know what happened to maintainers. Maybe something serious.
    – Pilot6
    Jul 28, 2015 at 21:23
1

That repository is not updated. You can install Oracle java 8u51 by a script now.

Run in terminal

sudo apt-get install git
git clone https://github.com/hanipouspilot/oracle-java8.git
cd oracle-java8
sudo chmod +x javains
sudo ./javains

I hope they will update the ppa soon, and I will not have to maintain java installation for good.

1
  • You can follow the steps detailed here: askubuntu.com/a/966347 which will allow you to install using the PPA. Its not as automated as one would like, but you do get the benefits of using their package.
    – Drahkar
    Oct 19, 2017 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .