Fedora 27系统,
以前安装过jdk9.0.4,oracle的,不是源里的openjdk。源里自带的用dnf就可以删除。
oracle的是下载rpm安装的,删除方法如下:$ java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
$ dnf list|grep jdk
Repository updates is listed more than once in the configuration
Repository fedora is listed more than once in the configuration
^CKeyboardInterrupt: Terminated.
$ rpm -qa|grep jdk
jdk-9.0.4-9.0.4-ga.x86_64
$ rpm -e --nodeps jdk-9.0.4-9.0.4-ga.x86_64
错误:无法创建 事务 锁定于 /var/lib/rpm/.rpm.lock (Permission denied)
$ sudo rpm -e --nodeps jdk-9.0.4-9.0.4-ga.x86_64
[sudo] xxx 的密码:
[ ~]$ _
以上关键还是用rpm -qa能迅速查到包名。dnf还要联网查询,太慢了而且不一定能成功。