Linux卸载jdk
第一、以root账号登录如下
[whutsun@localhost ~]$ su root
Password:
第二、查看系统已安装的jdk
[root@localhost whutsun]# rpm -qa|grep jdk
jdk-1.6.0_22-fcs
第三、卸载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
第四、再次卸载,提示JDK已被删除,系统没有安装jdk
[root@localhost whutsun]# rpm -e --nodeps jdk-1.6.0_22-fcs
error: package jdk-1.6.0_22-fcs is not installed
下面是卸载与JAVA相关的文件,命令用法与上面相同,如果一次要需要卸载多个文件,直接在空格分隔即可,如: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
至此所有与JAVA相关的文件删除完成。