Javaバージョンを削除できないのはなぜですか?

Javaバージョンを削除できないのはなぜですか?

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

自動アンインストールとしてマークされていないため、それに依存する他のパッケージがある可能性があります。

おすすめ記事