Uninstall jdk under centos

First, log in with the root account as follows
[whutsun@localhost ~]$ su root
Password: 
Second, check the installed jdk of the system
[root@localhost whutsun]# rpm -qa|grep jdk
jdk-1.6.0_22-fcs
Third, uninstall jdk
[root@localhost whutsun]# rpm -e --nodeps jdk-1.6.0_22-fcs
/var/tmp/rpm-tmp.17570: line 466: /usr/java/jdk1.6.0_22/bin/java: No such file or directory
Fourth, uninstall again, indicating that JDK has been deleted, and the system does not have jdk installed
[root@localhost whutsun]# rpm -e --nodeps jdk-1.6.0_22-fcs
error: package jdk-1.6.0_22-fcs is not installed
The following is to uninstall the files related to JAVA. The command usage is the same as above. If you need to uninstall multiple files at a time, you can directly separate them with spaces, such as: rpm -e --nodeps sun-javadb-javadoc-10.5.3-0.2 sun-javadb-common-10.5.3-0.2
 
[root@localhost whutsun]# rpm -qa|grep jdk
[root@localhost whutsun]# rpm -qa|grep java
sun-javadb-core-10.5.3-0.2
sun-javadb-demo-10.5.3-0.2
sun-javadb-javadoc-10.5.3-0.2
sun-javadb-common-10.5.3-0.2
sun-javadb-docs-10.5.3-0.2
[root@localhost whutsun]# rpm -e --nodeps sun-javadb-core-10.5.3-0.2
[root@localhost whutsun]# rpm -qa|grep java
sun-javadb-demo-10.5.3-0.2
sun-javadb-javadoc-10.5.3-0.2
sun-javadb-common-10.5.3-0.2
sun-javadb-docs-10.5.3-0.2
[root@localhost whutsun]# rpm -e --nodeps sun-javadb-demo-10.5.3-0.2
[root@localhost whutsun]# rpm -qa|grep java
sun-javadb-javadoc-10.5.3-0.2
sun-javadb-common-10.5.3-0.2
sun-javadb-docs-10.5.3-0.2
[root@localhost whutsun]# rpm -e --nodeps sun-javadb-javadoc-10.5.3-0.2 sun-javadb-common-10.5.3-0.2
[root@localhost whutsun]# rpm -qa|grep java
sun-javadb-docs-10.5.3-0.2
[root@localhost whutsun]# rpm -e --nodeps sun-javadb-docs-10.5.3-0.2
So far, all JAVA-related files have been deleted.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326564497&siteId=291194637