我从头安装了 Ubuntu 13.10,令我惊讶的是它安装的是 java 6(openjdk-6-jre)而不是 java 7(openjdk-7-jre)。
这个选择背后的原因是什么?
答案1
首先我们来分析一下ubuntu-restricted-extras
包的依赖关系:
apt-cache depends ubuntu-restricted-extras
ubuntu-restricted-extras
Depends: ubuntu-restricted-addons
Recommends: ttf-mscorefonts-installer
Recommends: unrar
Recommends: gstreamer0.10-plugins-bad-multiverse
Recommends: libavcodec-extra-53
Conflicts: ubuntu-restricted-extras:i386
这里不是java,让我们深入分析一下依赖关系ubuntu-restricted-addons
:
apt-cache depends ubuntu-restricted-addons
ubuntu-restricted-addons
Recommends: gstreamer0.10-plugins-ugly
Recommends: gstreamer1.0-plugins-ugly
Recommends: flashplugin-installer
flashplugin-installer:i386
Recommends: gstreamer0.10-plugins-bad
Recommends: gstreamer1.0-plugins-bad
Recommends: gstreamer0.10-ffmpeg
Recommends: gstreamer1.0-libav
Recommends: gstreamer0.10-fluendo-mp3
Conflicts: ubuntu-restricted-addons:i386
不,ubuntu-restricted-extras 不安装 java。实际上,只能以非常迂回的方式安装它。
$ aptitude why ubuntu-restricted-extras default-jdk
p ubuntu-restricted-extras Recommends ttf-mscorefonts-installer
i A ttf-mscorefonts-installer Depends update-notifier-common (>= 0.119ubuntu2)
i A update-notifier-common Depends debconf
i debconf Suggests debconf-doc
p debconf-doc Suggests debian-policy (>= 3.5)
p debian-policy Suggests doc-base
i A doc-base Suggests rarian-compat
p rarian-compat Depends docbook-xml
p docbook-xml Suggests docbook-xsl
p docbook-xsl Suggests libsaxon-java
p libsaxon-java Suggests libsaxon-java-doc
p libsaxon-java-doc Recommends default-jdk-doc
p default-jdk-doc Suggests default-jdk
$ aptitude why ubuntu-restricted-extras default-jre
p ubuntu-restricted-extras Recommends ttf-mscorefonts-installer
i A ttf-mscorefonts-installer Depends update-notifier-common (>= 0.119ubuntu2)
i A update-notifier-common Depends debconf
i debconf Suggests debconf-doc
p debconf-doc Suggests debian-policy (>= 3.5)
p debian-policy Suggests doc-base
i A doc-base Suggests rarian-compat
p rarian-compat Depends docbook-xml
p docbook-xml Suggests docbook-xsl
p docbook-xsl Suggests libxalan2-java
p libxalan2-java Suggests libxsltc-java
p libxsltc-java Depends jlex
p jlex Depends default-jre
$ aptitude why ubuntu-restricted-extras icedtea-plugin
p ubuntu-restricted-extras Recommends ttf-mscorefonts-installer
i A ttf-mscorefonts-installer PreDepends dpkg (>= 1.15.7.2)
i dpkg Suggests apt
i apt Suggests aptitude | synaptic | wajig
p wajig Suggests reportbug
i A reportbug Suggests claws-mail (>= 3.8.0)
p claws-mail Depends libenchant1c2a (>= 1.6)
i A libenchant1c2a Depends aspell-en | myspell-dictionary | aspell-dictionary | ispell-dictionary
| hunspell-dictionary
p myspell-uk Provides myspell-dictionary
p myspell-uk Suggests libreoffice
p libreoffice Suggests default-jre | gcj-jre | java-gcj-compat | openjdk-6-jre | openjdk-7-jre
| sun-java5-jre | sun-java6-jre | java5-runtime | jre
p openjdk-6-jre Suggests icedtea-plugin
因此,除非您提供更多信息,否则 ubuntu 软件包不会安装 java,除非您手动指定它。