-1

I'm running Ubuntu 16.04.1 LTS Desktop, but I followed the instructions for installing Oracle Java Runtime for the rpm packaged manager.

https://docs.oracle.com/javase/8/docs/technotes/guides/install/linux_jre.html#CFHBHAGI

rpm -ivh jre-8uversion-linux-x64.rpm

It failed to install and I just gave up on it. However, now when I use sudo apt-get upgrade I get a slew of errors.

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up jre1.8.0-101 (1.8.0101-1) ...
Unpacking JAR files...
        plugin.jar...
Error: Could not open input file: /usr/java/jre1.8.0_101/lib/plugin.pack
        javaws.jar...
Error: Could not open input file: /usr/java/jre1.8.0_101/lib/javaws.pack
        deploy.jar...
Error: Could not open input file: /usr/java/jre1.8.0_101/lib/deploy.pack
        rt.jar...
Error: Could not open input file: /usr/java/jre1.8.0_101/lib/rt.pack
        jsse.jar...
Error: Could not open input file: /usr/java/jre1.8.0_101/lib/jsse.pack
        charsets.jar...
Error: Could not open input file: /usr/java/jre1.8.0_101/lib/charsets.pack
        localedata.jar...
Error: Could not open input file: /usr/java/jre1.8.0_101/lib/ext/localedata.pack
/var/lib/dpkg/info/jre1.8.0-101.postinst: line 641: /usr/sbin/alternatives: No such file or directory
dpkg: error processing package jre1.8.0-101 (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 jre1.8.0-101
E: Sub-process /usr/bin/dpkg returned an error code (1)
$

How do I undo this process and fix up the apt-get system? Any explanation on why to not mix rpm with apt-get most welcome.

2
  • Why mix them? They are different, if they were same they will be 1
    – Anwar
    Sep 1, 2016 at 10:33
  • 1
    @Anwar Firstly, I'm new to Ubuntu. I had tried to run another package which wanted Oracle's JRE. I blindly followed the instructions on their website. Ubuntu command line told me to use Alien to convert to a .deb package first, so that's why I did it. Sep 1, 2016 at 17:25

2 Answers 2

0

try running

   $ sudo apt-get clean
   $ sudo apt-get update
   $ sudo apt-get -y upgrade

after running these commands restart your system. If you get an error in updating or upgrading try to repair your source.list file in /etc/apt/sources.list as: You can use this trick. Open a terminal ( Pressing Ctrl+Alt+T ) and do these

> Remove the corrupted one

  $ sudo rm /etc/apt/sources.list

> Open software-properties-gtk

  $ sudo software-properties-gtk

This will open software-properties-gtk and a new sources.list will be created automatically.

Then change the server to US or to any other server of your choice. You must enable repositories from the new dialog in order to create new sources.list.
0

I'm going to answer my own question as I found one way to apparently fix this.

I created a dummy /usr/sbin/alternatives file:

#!/bin/bash
echo "Do nothing"

Then sudo chmod +x /usr/sbin/alternatives.

Next, I put something in the /usr/java/ directory using sudo touch /usr/java/something.txt.

When I ran sudo apt-get purge jre1.8.0-101 it completed without errors or warnings. I did a reboot at this point. After rebooting I removed the two files above.

Now my system appears to be back to the state it was before I did the rpm install.

You must log in to answer this question.

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