卸载JDK rpm重新安装


11

在哪里可以找到要卸载的JDK安装?@terdon曾解释过使用rpm类型下载,这样卸载起来会更容易,但我找不到它。

Answers:


18

那包的名字是什么?

当您不知道要卸载的特定RPM的名称时,可以像使用命令那样搜索它rpm

$ rpm -aq | grep -i jdk
java-1.7.0-openjdk-devel-1.7.0.60-2.4.4.0.fc19.x86_64
jdk-1.7.0_45-fcs.x86_64
java-1.7.0-openjdk-1.7.0.60-2.4.4.0.fc19.x86_64

根据上面的输出,我安装了2个Java版本。正式的Oracler版本,jdk-1.7.0_45也称为IceTea版本。打开JDK ,java-1.7.0-openjdk-1.7.0.60-2.4.4.0

解除安装

要卸载Java(JDK)的正式版本,可以使用以下命令,yumrpm

百胜

$ sudo yum remove jdk
[sudo] password for saml: 
Loaded plugins: auto-update-debuginfo, changelog, langpacks, refresh-packagekit
Resolving Dependencies
--> Running transaction check
---> Package jdk.x86_64 2000:1.7.0_45-fcs will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================
 Package              Arch                    Version                               Repository                  Size
=====================================================================================================================
Removing:
 jdk                  x86_64                  2000:1.7.0_45-fcs                     installed                  193 M

Transaction Summary
=====================================================================================================================
Remove  1 Package

Installed size: 193 M
...

转数

$ sudo rpm -e jdk

我建议始终尝试使用,yum如果可以的话,它会执行依赖检查,rpm而不会。



是的,您必须进入他们的网站并通过浏览器下载文件。然后用于scp将它们复制到其他无头服务器。
slm

2

搜索预装的JAVA:

$ rpm -qa | grep java
javapackages-tools-3.4.1-11.el7.noarch
java-1.8.0-openjdk-headless-1.8.0.151-5.b12.el7_4.x86_64

使用以下命令删除:

rpm -e java-1.8.0-openjdk-headless-1.8.0.151-5.b12.el7_4.x86_64
rpm -e javapackages-tools-3.4.1-11.el7.noarch

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.