Uninstall Java from Ubuntu using APT Command
If you want to remove the Java package from Ubuntu you can make use of the apt-get remove command followed by package name,
- Open Terminal
- Type sudo apt-get autoremove openjdk-8-jre package-name example: openjdk-8-jre
- When prompted, Do you want to continue? [Y/n] type yes or y
- Let's try if Java got installed,
Processing triggers for libc-bin (2.31-0ubuntu9) ... $ java -version Command 'java' not found, but can be installed with: apt install openjdk-11-jre-headless # version 11.0.8+10-0ubuntu1~20.04, or apt install default-jre # version 2:1.11-72 apt install openjdk-13-jre-headless # version 13.0.3+3-1ubuntu2 apt install openjdk-14-jre-headless # version 14.0.1+7-1ubuntu1 apt install openjdk-8-jre-headless # version 8u265-b01-0ubuntu2~20.04
$ sudo apt-get autoremove openjdk-8-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
adwaita-icon-theme at-spi2-core ca-certificates-java fontconfig fonts-dejavu-extra gtk-update-icon-cache
hicolor-icon-theme humanity-icon-theme java-common libatk-bridge2.0-0 libatk-wrapper-java libatk-wrapper-java-jni
libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data libavahi-common3 libcairo-gobject2
libcairo2 libcups2 libdatrie1 libgail-common libgail18 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin
libgdk-pixbuf2.0-common libgif7 libgraphite2-3 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libharfbuzz0b libjbig0
libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
libpcsclite1 libpixman-1-0 librsvg2-2 librsvg2-common libthai-data libthai0 libtiff5 libwebp6 libxcb-render0
libxcb-shm0 libxcursor1 openjdk-8-jre-headless ubuntu-mono
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
openjdk-8-jre
0 upgraded, 0 newly installed, 1 to remove and 163 not upgraded.
After this operation, 287 kB disk space will be freed.
Do you want to continue? [Y/n] yes
(Reading database ... 46202 files and directories currently installed.)
Removing openjdk-8-jre:amd64 (8u265-b01-0ubuntu2~20.04) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Processing triggers for mime-support (3.64ubuntu1) ...
.
.
Removing libcairo2:amd64 (1.16.0-4ubuntu1) ...
Removing libthai0:amd64 (0.1.28-3) ...
Removing libdatrie1:amd64 (0.2.12-3) ...
Removing libgdk-pixbuf2.0-0:amd64 (2.40.0+dfsg-3) ...
Removing libgdk-pixbuf2.0-common (2.40.0+dfsg-3) ...
Removing libharfbuzz0b:amd64 (2.6.4-1ubuntu4) ...
Removing libgraphite2-3:amd64 (1.3.13-11build1) ...
Removing libtiff5:amd64 (4.1.0+git191117-2build1) ...
Removing libjbig0:amd64 (2.1-3.1build1) ...
Removing libjpeg8:amd64 (8c-2ubuntu8) ...
Removing libjpeg-turbo8:amd64 (2.0.3-0ubuntu1.20.04.1) ...
Removing libnss3:amd64 (2:3.49.1-1ubuntu1.5) ...
Removing libnspr4:amd64 (2:4.25-1) ...
Removing libpixman-1-0:amd64 (0.38.4-0ubuntu1) ...
Removing libthai-data (0.1.28-3) ...
Removing libwebp6:amd64 (0.6.1-2) ...
Removing libxcb-render0:amd64 (1.14-2) ...
Removing libxcb-shm0:amd64 (1.14-2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for ca-certificates (20190110ubuntu1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
updates of cacerts keystore disabled.
done.
More Posts related to Linux,
- Command to know the Available Memory on Linux System
- How to install curl on Alpine Linux
- How to backup a file in Linux/Unix
- Install Java Runtime Environment (Oracle or open JRE) on Ubuntu
- What is the Default Admin user and Password for Jenkins
- How to tar.gz a directory or folder Command
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- Fix: bash: ipconfig: command not found on Linux
- Command to check Last Login or Reboot History of Users and TTYs
- Linux: Create a New User and Password and Login Example
- ls command to list only directories
- bash: cls: command not found
- How to exit from nano command
- Installing and using unzip Command to unzip a zip file using Terminal
- What does apt-get update command does?
- ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash]
- How to remove or uninstall Java from Ubuntu using apt-get
- scp: ssh: connect to host xxxx port 22: Connection refused Error
- Sort ls command by last modified date and time
- Create Nested Directories using mkdir Command
- How to Exit a File in Terminal (Bash/Zsh)
- Command to know the installed Debian version?
- How to connect to SSH port other than default 22
- How to save a file in Nano Editor and Exit
- Install OpenSSL on Linux/Ubuntu
More Posts:
- Clone a particular remote brach using git clone command - Git
- Fix Error 2711 SQL RBS client - The installer has encountered an unexpected error. The specified Feature name ('Docs') not found in Feature table - SharePoint
- How to Check if a Date is Empty (null) or not in Java - Java
- Install Bash on Alpine Linux - Docker - Docker
- [fix] bash: ssh: command not found - Bash
- Fix: This file is set to read-only. Try again with a different file name. [Windows 10/11] - Windows
- Android xml error Attribute is missing the Android namespace prefix [Solution] - Android
- Create Safari Shortcut on Mac Desktop - MacOS