Why installing openjdk-7-jdk on Ubuntu Trusty installs systemd as well?

sktsee sktseer at gmail.com
Tue Jan 3 21:16:32 UTC 2017


On Tue, 03 Jan 2017 20:21:07 +0000, Colin Law wrote:

> On 3 January 2017 at 19:55, sktsee <sktseer at gmail.com> wrote:
>> On Tue, 03 Jan 2017 12:09:37 +0200, Yuri Kanivetsky wrote:
>>
>>> In lxc containers you usually get pretty basic set of packages. For
>>> example, in Ubuntu Trusty man and curl packages are not
>>> "preinstalled".
>>> In other distributions there was no less and ping right away, AFAIR.
>>>
>>> And AFAIU, lxc containers use kernel of the host machine. It's not
>>> that I see how it can affect installing openjdk in the guest. But it
>>> makes sense to check it with Virtualbox, after all. What I'm planning
>>> to do one of these days.
>>
>> It's probably being pulled in as :Recommends dependency. If you specify
>> "--no-install-recommends" with apt-get, it'll might leave systemd off.
>> Of course, it will leave other recommended packages that you may want
>> to be installed off as well. You'll just need to compare the output
>> from the two simulated apt commands.
>>
>> See what the following does:
>>
>> $ sudo apt-get -s install --no-install-recommends openjdk-7-jdk
>>
>> Also, if it looks like systemd is going to be installed regardless of
>> the no-install-recommends option (some os components like udev rely on
>> systemd functions), you could install the package systemd-shim to
>> provide systemd functionality for systemd services without using it as
>> the init service.
> 
> What is not explained is why on my 14.04 system it does not try to
> install systemd, but on this one it does.
> 

A 14.04 desktop system will already have systemd-shim installed, whereas 
on a minimal 14.04 host system it won't have any systemd related packages 
installed. When installing openjdk-7-jdk with the default option of 
including packages with the :Recommends dependency, it pulled something 
that depended on the systemd-services package. It you take a look at the 
package information for systemd-services, you'll notice that it has this 
dependency at the end:

,systemd | systemd-shim (>= 3) 

So either the package systemd or systemd-shim will satisfy the dependency 
for systemd-services. I believe that since systemd is listed first, the 
resolver chooses it over systemd-shim when installing. That's my theory 
anyway.

-- 
sktsee





More information about the ubuntu-users mailing list