Uninstall default-jdk

Uninstall default-jdk



I'm on a fresh Ubuntu 18.04 install. I did a sudo apt-get install default-jdk. Result:


sudo apt-get install default-jdk


java --version
openjdk 10.0.2 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)



Now I did sudo apt-get purge default-jdk. Result:


sudo apt-get purge default-jdk


java --version
openjdk 10.0.2 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)



Why is OpenJDK still there?




1 Answer
1



default-jdk in 18.04 has the following description:


default-jdk


Description: Standard Java or Java compatible Development Kit
This dependency package points to the Java runtime, or Java compatible
development kit recommended for this architecture, which is
openjdk-11-jdk for amd64.



The results of apt-cache depends default-jdk are as follows:


apt-cache depends default-jdk


default-jdk
Depends: default-jre
Depends: default-jdk-headless
Depends: openjdk-11-jdk



The results of apt-cache rdepends default-jdk show that openjdk-11-jdk does not depend on default-jdk. default-jdk points to a Java runtime or Java compatible development kit, but uninstalling default-jdk does not uninstall either of these packages.


apt-cache rdepends default-jdk



To remove the packages installed by default-jdk, run the following command:


sudo apt remove openjdk-11-jre-headless openjdk-11-jre openjdk-11-jdk-headless openjdk-11-jdk






Since default-jdk depends on openjdk-11-jdk, then wouldn't removing default-jdk followed by a sudo apt-get autoremove accomplish the same?

– Android Dev
Sep 17 '18 at 14:18



default-jdk


openjdk-11-jdk


default-jdk


sudo apt-get autoremove






@AndroidDev I replied to your comment by editing my answer. My reply is in the 5th paragraph.

– karel
Sep 17 '18 at 14:31






After sudo apt-get install default-jdk I use apt list --installed | grep openj to see that the packages openjdk-11-jre-headless, openjdk-11-jre, openjdk-11-jdk-headless and openjdk-11-jdk are installed. I use apt list --installed | grep openj again after a sudo apt-get purge default-jdk to see that all 4 packages are still there. After sudo apt-get autoremove the 2 jdk packages are gone but the 2 jre packages are still there!

– Robert
Sep 17 '18 at 14:46


sudo apt-get install default-jdk


apt list --installed | grep openj


apt list --installed | grep openj


sudo apt-get purge default-jdk


sudo apt-get autoremove






oh I should add that in the meantime I have done a sudo apt-get install openjdk-8-jdk (which has solved my actual problem which I haven't described). So maybe that's the reason why he keeps the jre11 packages despite an autoremove? Which would be weird because why would OpenJDK8 want to have those packages. Anyway, now I have both, default-jdk and openjdk-8-jdk. I switch between the two via sudo update-java-alternatives.

– Robert
Sep 17 '18 at 15:00


sudo apt-get install openjdk-8-jdk


sudo update-java-alternatives



Thanks for contributing an answer to Ask Ubuntu!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Crossroads (UK TV series)

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế