Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When i want to remove openjdk it says that tomcat will be removed too.

apt-get remove openjdk-6-jre-headless
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libcommons-pool-java libecj-java authbind libnss3 libjpeg-turbo8 libjpeg8 java-common libavahi-common-data libservlet3.0-java
  libcups2 tzdata-java libnspr4 libavahi-client3 libcommons-collections3-java libavahi-common3 libnss3-1d
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  ca-certificates-java default-jre-headless icedtea-6-jre-cacao icedtea-6-jre-jamvm libcommons-dbcp-java libtomcat7-java
  openjdk-6-jre-headless openjdk-6-jre-lib tomcat7 tomcat7-admin tomcat7-common
0 upgraded, 0 newly installed, 11 to remove and 50 not upgraded.
After this operation, 93.7 MB disk space will be freed.
Do you want to continue [Y/n]? 

How can i remove openjdk without removing tomcat ?

share|improve this question

migrated from stackoverflow.com Nov 25 '13 at 14:21

This question came from our site for professional and enthusiast programmers.

    
My another suggestion is, that I had always problems with the deb-packaged java. Finally I can most efficient work in a java environment, if I have a fully java-free linux, extended with original java packages download from the oracle. –  Peter Horvath Nov 25 '13 at 16:00

3 Answers 3

up vote 1 down vote accepted

What you want is:

dpkg --force-depends --purge openjdk-6-jre-headless openjdk-6-jre-lib icedtea-6-jre-jvmvm

So, dpkg --force-depends is the key.

share|improve this answer
    
Thanks. After researching for hours I found that only this that actually works. Could you explain your answer with what this actually does ? –  user01 Mar 21 at 18:39

Tomcat requires a Java runtime environment (JRE) to run. The openjdk-6-jre-headless package is apparently the only JRE installed on your system. You can't remove it but keep Tomcat because Tomcat won't work without it.

If you install some other JRE package first, such as openjdk-7-jre, then you should be able to remove openjdk-6-jre-headless without removing Tomcat, because Tomcat's dependency on a JRE will still be satisfied.

share|improve this answer
    
I already have 2 more jdks installed –  user2361682 Nov 25 '13 at 14:35
1  
Take a look at Tomcat's dependencies: apt-cache show tomcat7-common. You should see something like default-jre-headless | java6-runtime-headless | java6-runtime | java-6-runtime. Then run apt-cache show on your other JRE packages and look at the Provides: line. Do they provide what Tomcat depends on? –  Wyzard Nov 25 '13 at 14:37

As u can see in below message, It describes the packages that are about to get uninstalled.

The following packages will be REMOVED:

ca-certificates-java default-jre-headless icedtea-6-jre-cacao icedtea-6-jre-jamvm   
libcommons-dbcp-java libtomcat7-java openjdk-6-jre-headless openjdk-6-jre-lib 
tomcat7 tomcat7-admin tomcat7-common

Hence it will remove tomcat packages.

share|improve this answer
1  
Does not answer the question that was asked. –  user1291332 Nov 25 '13 at 14:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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