作者:赵娜supergirl | 来源:互联网 | 2024-11-03 09:05
在Ubuntu13.04系统中,如果希望移除OpenJDK以优化Java环境配置,但尝试卸载`openjdk-7-jre`时遇到了问题。具体命令`$sudoapt-getpurgeopenjdk-7-jre`会显示如下提示信息:
我不希望在我的Ubuntu 13.04系统上安装OpenJDK,但是尝试卸载openjdk-7-jre会产生以下消息:
$sudo apt-get purge openjdk-7-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
gcj-4.7-base gcj-4.7-jre gcj-4.7-jre-headless gcj-4.7-jre-lib gcj-jre gcj-jre-headless icedtea-6-jre-cacao icedtea-6-jre-jamvm libgcj-common libgcj13 libgcj13-awt
openjdk-6-jre-headless openjdk-6-jre-lib
Suggested packages:
fastjar gcj-4.7-jdk gcj-jdk libgcj13-dbg sun-java6-fonts fonts-ipafont-gothic fonts-ipafont-mincho ttf-telugu-fonts ttf-oriya-fonts ttf-kannada-fonts
ttf-bengali-fonts
The following packages will be REMOVED:
default-jre* icedtea-7-plugin* icedtea-netx* icedtea-plugin* libatk-wrapper-java* libatk-wrapper-java-jni* openjdk-7-jre*
The following NEW packages will be installed:
gcj-4.7-base gcj-4.7-jre gcj-4.7-jre-headless gcj-4.7-jre-lib gcj-jre gcj-jre-headless icedtea-6-jre-cacao icedtea-6-jre-jamvm libgcj-common libgcj13 libgcj13-awt
openjdk-6-jre-headless openjdk-6-jre-lib
0 upgraded, 13 newly installed, 7 to remove and 4 not upgraded.
Need to get 57,0 MB/57,2 MB of archives.
After this operation, 156 MB of additional disk space will be used.
Do you want to continue [Y/n]?
我需要做什么,以便在删除openjdk-7时不会安装我不需要的新软件包?
解决方法:
您可以使用以下命令:
sudo apt-get purge openjdk-8-jre openjdk-8-jre-headless openjdk-7-jre gcj-4.7-base gcj-4.7-jre openjdk-6-jre-headless
这样就不会安装新的软件包.这是我上面命令的输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'gcj-4.7-base' is not installed, so not removed
Package 'gcj-4.7-jre' is not installed, so not removed
Package 'openjdk-6-jre-headless' is not installed, so not removed
The following packages will be REMOVED:
default-jre* icedtea-7-plugin* icedtea-netx* libatk-wrapper-java*
libatk-wrapper-java-jni* libreoffice-base* minecraft-installer*
openjdk-7-jre*
0 upgraded, 0 newly installed, 8 to remove and 6 not upgraded.
After this operation, 10,3 MB disk space will be freed.
Do you want to continue [Y/n]? n
但是,我不建议你这样做.有一天你需要确定一个OpenJDK(6或7).