openjdk-17-jre 및 jdk를 제거합니다.
sudo apt remove openjdk-17-jre openjdk-17-jdk
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
openjdk-17-jdk-headless
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
openjdk-17-jdk openjdk-17-jre
0 upgraded, 0 newly installed, 2 to remove and 1 not upgraded.
After this operation, 9,250 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 295782 files and directories currently installed.)
Removing openjdk-17-jdk:amd64 (17~19-1) ...
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
Removing openjdk-17-jre:amd64 (17~19-1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
debian@debian:~/Downloads$ java -version
openjdk version "17-ea" 2021-09-14
OpenJDK Runtime Environment (build 17-ea+19-Debian-1)
OpenJDK 64-Bit Server VM (build 17-ea+19-Debian-1, mixed mode, sharing)
debian@debian:~/Downloads$ sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
openjdk-17-jdk-headless
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
After this operation, 248 MB disk space will be freed.
Do you want to continue? [Y/n] y
다시 시작하고 로그인하세요.
java -version
openjdk version "17-ea" 2021-09-14
OpenJDK Runtime Environment (build 17-ea+19-Debian-1)
OpenJDK 64-Bit Server VM (build 17-ea+19-Debian-1, mixed mode, sharing)
Java 버전을 삭제할 수 없는 이유는 무엇입니까?
답변1
다음 항목도 제거해야 합니다 openjdk-17-jre-headless
.
sudo apt purge openjdk-17-jre-headless
자동 제거로 표시되지 않았기 때문에 여전히 이에 의존하는 다른 패키지가 있을 수 있습니다.