Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have been been running trusty since the first alpha release, pulling daily updates. I also installed the oracle-java7-installer from the WebUpd8 PPA. Today I noticed during a dist-upgrade that oracle-java7-installer was being removed. On my edge system I just allow all the defaults so I allowed the removal expecting to try out the java 8 version anyway. However when I went to install the oracle-java8-installer package it wanted to remove "apt"!? This obviously sparked my concern, as it even feels like a security concern. Help understanding this would be greatly appreciated.

$ sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  visualvm ttf-baekmuk ttf-unfonts ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho
  ttf-arphic-uming
The following packages will be REMOVED:
  apt apturl nautilus-share python3-software-properties software-center software-properties-common software-properties-gtk
  ubuntu-extras-keyring ubuntu-minimal unattended-upgrades
The following NEW packages will be installed:
  oracle-java8-installer
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  apt
0 upgraded, 1 newly installed, 10 to remove and 0 not upgraded.
Need to get 18.7 kB of archives.
After this operation, 7,838 kB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?] 
share|improve this question

closed as off-topic by Braiam, Rafał Cieślak, chronitis, Lucio, BuZZ-dEE Apr 7 at 17:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Bug reports and problems with the development version of Ubuntu should be reported on Launchpad so that developers can see, track and fix these issues." – Braiam, Rafał Cieślak, chronitis, Lucio, BuZZ-dEE
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Please Don't do that. –  Avinash Raj Apr 4 at 16:21
1  
@AvinashRaj: I think he knows that. :) @Lance: I suspect it was something in the apt-get dist-upgrade that is causing this problem, as the installer package has very few dependencies and one conflict, and oracle-java7-installer shouldn't have been removed. –  saiarcot895 Apr 4 at 16:28
1  
Try to hold all the important packages shown above and then try to install oracle-java8-installer package. –  Avinash Raj Apr 4 at 16:33
1  
@AvinashRaj: j2se-common –  saiarcot895 Apr 4 at 16:35
1  
This should not occur, please report a bug. –  Braiam Apr 4 at 21:28

3 Answers 3

up vote 7 down vote accepted

This recent change referenced in the 'apt' package ChangeLog appears to be the likely culprit:

apt (0.9.15.4ubuntu4) trusty; urgency=low

  Cherry pick fixes from the apt 1.0 branch:

  [ Michael Vogt ]
  * add sun-java{5,6}-jdk to breaks/replaces as that provided a "apt"
    binary as well

The oracle-java8-installer package "Provides" the "sun-java6-jdk" package, so this conflict bubbles up and prevents us from installing the WebUpd8 packages -- even though neither oracle-java7-installer nor oracle-java8-installer actually installs the problematic "apt" binary mentioned in the apt changelog.

I went ahead and submitted a bug report for this: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1302736

share|improve this answer
    
thanks for the bug report. –  Lance Caraccioli Apr 4 at 22:14

Andy S has the underlying problem here and I'd expect a fix out soon. Please use the bug report link he provided and indicate that it also affects you so that it gains higher priority.

If you absolutely can't wait, here's a temporary workaround to ignore the dependency issues and force the install:

  • Download the .deb package from apt sudo apt-get download oracle-java7-installer

  • Do the install of the .deb you just downloaded, ignoring any dependencies apt complains about: sudo dpkg -i --ignore-depends=apt file-you-just-downloaded.deb

Two items of note:

  1. you can use this similarly for Java 8 by changing the commands above accordingly.
  2. For at least the time being, your apt will think it has a broken dependency and request removing oracle-java7-installer. You can revert back by using apt-get -f install.
share|improve this answer

Another workaround until this gets fixed is to modify the deb file from webupd8 and remove sun-java6-jdk from the Provides line in the deb control file. There's a handy script in this answer on superuser.com. Just grab the original file, run the script on it, modify the Provides line and install the modified file with sudo dpkg -i.

I uploaded the modified package, but I highly suggest to use the original file and do the modification yourself, since you shouldn't install stuff by random people on the internet ;)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.