Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #262217 > unrolled thread

Understanding package dependencies

Started bySteve Keller <keller.steve@gmx.de>
First post2023-10-07 14:10 +0200
Last post2023-10-09 14:20 +0200
Articles 10 — 6 participants

Back to article view | Back to linux.debian.user


Contents

  Understanding package dependencies Steve Keller <keller.steve@gmx.de> - 2023-10-07 14:10 +0200
    Re: Understanding package dependencies Michael Kjörling <2695bd53d63c@ewoof.net> - 2023-10-07 15:10 +0200
      Re: Understanding package dependencies Greg Wooledge <greg@wooledge.org> - 2023-10-07 15:30 +0200
        Re: Understanding package dependencies Steve Keller <keller.steve@gmx.de> - 2023-10-07 19:50 +0200
          Re: Understanding package dependencies Greg Wooledge <greg@wooledge.org> - 2023-10-07 20:20 +0200
          Re: Understanding package dependencies Sven Joachim <svenjoac@gmx.de> - 2023-10-07 20:30 +0200
            Re: Understanding package dependencies Greg Wooledge <greg@wooledge.org> - 2023-10-07 20:50 +0200
              Re: Understanding package dependencies Jörg-Volker Peetz <jvpeetz@web.de> - 2023-10-08 10:50 +0200
                Re: Understanding package dependencies Greg Wooledge <greg@wooledge.org> - 2023-10-08 14:40 +0200
              Re: Understanding package dependencies Max Nikulin <manikulin@gmail.com> - 2023-10-09 14:20 +0200

#262217 — Understanding package dependencies

FromSteve Keller <keller.steve@gmx.de>
Date2023-10-07 14:10 +0200
SubjectUnderstanding package dependencies
Message-ID<Hmei7-e9Z4-23@gated-at.bofh.it>
I've always thought, that a package's dependencies must be full-filled
to install that package and that apt-get automatically manages these
dependencies.  And also, that if I remove a package, that all other
packages are removed, that depend on it.  Like this:

    # aptitude purge bind9-libs
    The following packages will be REMOVED:
      bind9-libs{p} libjemalloc2{u}
    0 packages upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
    Need to get 0 B of archives. After unpacking 4668 kB will be freed.
    The following packages have unmet dependencies:
     bind9-host : Depends: bind9-libs (= 1:9.18.19-1~deb12u1) but it is not going to be installed
     bind9 : Depends: bind9-libs (= 1:9.18.19-1~deb12u1) but it is not going to be installed
     bind9-dnsutils : Depends: bind9-libs (= 1:9.18.19-1~deb12u1) but it is not going to be installed
     bind9-utils : Depends: bind9-libs (= 1:9.18.19-1~deb12u1) but it is not going to be installed
    The following actions will resolve these dependencies:

         Remove the following packages:
    1)     bind9 [1:9.18.19-1~deb12u1 (now, stable-security)]
    2)     bind9-dnsutils [1:9.18.19-1~deb12u1 (now, stable-security)]
    3)     bind9-host [1:9.18.19-1~deb12u1 (now, stable-security)]
    4)     bind9-utils [1:9.18.19-1~deb12u1 (now, stable-security)]


But how can this then be explained?

    # aptitude why lsb-base
    i   ntpsec Depends lsb-base
    # aptitude show ntpsec | grep ^Depends
    Depends: adduser, lsb-base, netbase, python3, python3-ntp (= 1.2.2+dfsg1-1+deb12u1), tzdata, libbsd0 (>= 0.0), libc6 (>= 2.34), libcap2 (>= 1:2.10), libssl3 (>= 3.0.0)
    # aptitude purge lsb-base
    The following packages will be REMOVED:
      lsb-base{p}
    0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    Need to get 0 B of archives. After unpacking 12.3 kB will be freed.
    Do you want to continue? [Y/n/?]

Won't continuing here leave ntpsec with an unresolved package dependency?

Steve

[toc] | [next] | [standalone]


#262218

FromMichael Kjörling <2695bd53d63c@ewoof.net>
Date2023-10-07 15:10 +0200
Message-ID<Hmfe9-eaxP-3@gated-at.bofh.it>
In reply to#262217
On 7 Oct 2023 13:47 +0200, from keller.steve@gmx.de (Steve Keller):
> But how can this then be explained?
> 
>     # aptitude why lsb-base
>     i   ntpsec Depends lsb-base
>     # aptitude show ntpsec | grep ^Depends
>     Depends: adduser, lsb-base, netbase, python3, python3-ntp (= 1.2.2+dfsg1-1+deb12u1), tzdata, libbsd0 (>= 0.0), libc6 (>= 2.34), libcap2 (>= 1:2.10), libssl3 (>= 3.0.0)
>     # aptitude purge lsb-base
>     The following packages will be REMOVED:
>       lsb-base{p}
>     0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
>     Need to get 0 B of archives. After unpacking 12.3 kB will be freed.
>     Do you want to continue? [Y/n/?]
> 
> Won't continuing here leave ntpsec with an unresolved package dependency?

I'm not sure if that's it, and I'm pretty sure I've never seen a `{p}`
(is that aptitude's way of indicating that a package will be purged
rather than just uninstalled; that which apt-get shows as `*`?), but
might at least a partial explanation be that lsb-base in Bookworm is
an empty transitional package?

On a freshly installed and up-to-date Bookworm VM, installing ntpsec
doesn't pull in lsb-base (the only additional package pulled in by
`apt-get install ntpsec` is python3-ntp), nor is lsb-base installed
after installation.

-- 
Michael Kjörling                     🔗 https://michael.kjorling.se
“Remember when, on the Internet, nobody cared that you were a dog?”

[toc] | [prev] | [next] | [standalone]


#262220

FromGreg Wooledge <greg@wooledge.org>
Date2023-10-07 15:30 +0200
Message-ID<Hmfxv-eaEf-7@gated-at.bofh.it>
In reply to#262218
On Sat, Oct 07, 2023 at 01:04:56PM +0000, Michael Kjörling wrote:
> On 7 Oct 2023 13:47 +0200, from keller.steve@gmx.de (Steve Keller):
> >     # aptitude purge lsb-base
> >     The following packages will be REMOVED:
> >       lsb-base{p}
> >     0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
> >     Need to get 0 B of archives. After unpacking 12.3 kB will be freed.
> >     Do you want to continue? [Y/n/?]
> > 
> > Won't continuing here leave ntpsec with an unresolved package dependency?

> I'm not sure if that's it, and I'm pretty sure I've never seen a `{p}`
> (is that aptitude's way of indicating that a package will be purged
> rather than just uninstalled; that which apt-get shows as `*`?), but
> might at least a partial explanation be that lsb-base in Bookworm is
> an empty transitional package?

That's definitely part of the whole picture, yes.

Package: sysvinit-utils
[...]
Provides: lsb-base (= 11.1.0)

When you remove the physical lsb-base package, the virtual package
provided by sysvinit-utils remains, to satisfy the dependencies of
ntpsec, rsync, etc.

[toc] | [prev] | [next] | [standalone]


#262225

FromSteve Keller <keller.steve@gmx.de>
Date2023-10-07 19:50 +0200
Message-ID<HmjB7-ecWJ-9@gated-at.bofh.it>
In reply to#262220
Greg Wooledge <greg@wooledge.org> writes:

> Package: sysvinit-utils
> [...]
> Provides: lsb-base (= 11.1.0)
>
> When you remove the physical lsb-base package, the virtual package
> provided by sysvinit-utils remains, to satisfy the dependencies of
> ntpsec, rsync, etc.

OK, that explains, why lsb-base can be removed without ntpsec. Is there
a way to search for "Provides" in packages? I.e. show me all packages
(installed or all) that provide some feature "foobar"?

Steve

[toc] | [prev] | [next] | [standalone]


#262226

FromGreg Wooledge <greg@wooledge.org>
Date2023-10-07 20:20 +0200
Message-ID<Hmk4a-edlQ-5@gated-at.bofh.it>
In reply to#262225
On Sat, Oct 07, 2023 at 07:24:24PM +0200, Steve Keller wrote:
> Greg Wooledge <greg@wooledge.org> writes:
> 
> > Package: sysvinit-utils
> > [...]
> > Provides: lsb-base (= 11.1.0)
> >
> > When you remove the physical lsb-base package, the virtual package
> > provided by sysvinit-utils remains, to satisfy the dependencies of
> > ntpsec, rsync, etc.
> 
> OK, that explains, why lsb-base can be removed without ntpsec. Is there
> a way to search for "Provides" in packages? I.e. show me all packages
> (installed or all) that provide some feature "foobar"?

I couldn't find one within a minute or so of looking, so I simply
searched for "Provides:.*lsb-base" in /var/lib/dpkg/status.

Now that I've had a bit more time to ponder it, I recall that there's
"apt-cache showpkg".  It's not intuitive or easy to remember, but....

unicorn:~$ apt-cache showpkg lsb-base
Package: lsb-base
[... LOTS of useless info ...]
Dependencies: 
11.6 - sysvinit-utils (2 3.05-4~) 
Provides: 
11.6 - lsb-base:i386 (= 11.6) 
Reverse Provides: 
sysvinit-utils:i386 3.06-4 (= 11.1.0)
sysvinit-utils 3.06-4 (= 11.1.0)

[toc] | [prev] | [next] | [standalone]


#262227

FromSven Joachim <svenjoac@gmx.de>
Date2023-10-07 20:30 +0200
Message-ID<HmkdP-edoX-19@gated-at.bofh.it>
In reply to#262225
On 2023-10-07 19:24 +0200, Steve Keller wrote:

> Greg Wooledge <greg@wooledge.org> writes:
>
>> Package: sysvinit-utils
>> [...]
>> Provides: lsb-base (= 11.1.0)
>>
>> When you remove the physical lsb-base package, the virtual package
>> provided by sysvinit-utils remains, to satisfy the dependencies of
>> ntpsec, rsync, etc.
>
> OK, that explains, why lsb-base can be removed without ntpsec. Is there
> a way to search for "Provides" in packages? I.e. show me all packages
> (installed or all) that provide some feature "foobar"?

Yes, aptitude can do that.   Quoting the manual[1]:

,----
| ?provides(pattern), ~Ppattern
| 
|     Matches package versions which provide a package that matches the
|     pattern. For instance, “?provides(mail-transport-agent)” will match
|     all the packages that provide “mail-transport-agent”.
`----

In the current case, "aptitude search '~Plsb-base'" does the trick.

Cheers,
       Sven


1. https://www.debian.org/doc/manuals/aptitude/ch02s04s05.en.html#searchProvides

[toc] | [prev] | [next] | [standalone]


#262228

FromGreg Wooledge <greg@wooledge.org>
Date2023-10-07 20:50 +0200
Message-ID<Hmkxc-edvr-11@gated-at.bofh.it>
In reply to#262227
On Sat, Oct 07, 2023 at 08:27:11PM +0200, Sven Joachim wrote:
> Yes, aptitude can do that.   Quoting the manual[1]:
> 
> ,----
> | ?provides(pattern), ~Ppattern
> | 
> |     Matches package versions which provide a package that matches the
> |     pattern. For instance, “?provides(mail-transport-agent)” will match
> |     all the packages that provide “mail-transport-agent”.
> `----
> 
> In the current case, "aptitude search '~Plsb-base'" does the trick.

Why on EARTH was this not ported to apt-patterns(7)?

unicorn:~$ apt list '?conflicts(~nlsb-base)'
Listing... Done
sysvinit-utils/stable,now 3.06-4 amd64 [installed]
sysvinit-utils/stable 3.06-4 i386
unicorn:~$ apt list '?provides(~nlsb-base)'
Listing... Error!
E: input:0-21: error: Unrecognized pattern '?provides'
   ?provides(~nlsb-base)
   ^^^^^^^^^^^^^^^^^^^^^

[toc] | [prev] | [next] | [standalone]


#262234

FromJörg-Volker Peetz <jvpeetz@web.de>
Date2023-10-08 10:50 +0200
Message-ID<HmxE5-elRd-5@gated-at.bofh.it>
In reply to#262228
Greg Wooledge wrote on 07/10/2023 20:45:
> On Sat, Oct 07, 2023 at 08:27:11PM +0200, Sven Joachim wrote:
>> Yes, aptitude can do that.   Quoting the manual[1]:
>>
>> ,----
>> | ?provides(pattern), ~Ppattern
>> |
>> |     Matches package versions which provide a package that matches the
>> |     pattern. For instance, “?provides(mail-transport-agent)” will match
>> |     all the packages that provide “mail-transport-agent”.
>> `----
>>
>> In the current case, "aptitude search '~Plsb-base'" does the trick.
> 
> Why on EARTH was this not ported to apt-patterns(7)?
> 
> unicorn:~$ apt list '?conflicts(~nlsb-base)'
> Listing... Done
> sysvinit-utils/stable,now 3.06-4 amd64 [installed]
> sysvinit-utils/stable 3.06-4 i386
> unicorn:~$ apt list '?provides(~nlsb-base)'
> Listing... Error!
> E: input:0-21: error: Unrecognized pattern '?provides'
>     ?provides(~nlsb-base)
>     ^^^^^^^^^^^^^^^^^^^^^
> 
How about

   apt list '?reverse-depends(?name(lsb-base))'

or

   apt list '~RDepends:~nlsb-base'

Regards,
Jörg.

[toc] | [prev] | [next] | [standalone]


#262249

FromGreg Wooledge <greg@wooledge.org>
Date2023-10-08 14:40 +0200
Message-ID<HmBeF-eo1f-3@gated-at.bofh.it>
In reply to#262234
On Sun, Oct 08, 2023 at 10:47:58AM +0200, Jörg-Volker Peetz wrote:
> Greg Wooledge wrote on 07/10/2023 20:45:
> > unicorn:~$ apt list '?provides(~nlsb-base)'
> > Listing... Error!
> > E: input:0-21: error: Unrecognized pattern '?provides'
> >     ?provides(~nlsb-base)
> >     ^^^^^^^^^^^^^^^^^^^^^
> > 
> How about
> 
>   apt list '?reverse-depends(?name(lsb-base))'

Reverse-depends isn't the same as Provides, though.

unicorn:~$ aptitude search '~Pmail-transport-agent'
p   courier-mta                     - Courier mail server - ESMTP daemon        
p   courier-mta:i386                - Courier mail server - ESMTP daemon        
p   dma                             - lightweight mail transport agent          
p   dma:i386                        - lightweight mail transport agent          [...]
unicorn:~$ apt list '?reverse-depends(~nmail-transport-agent)'
Listing... Done
unicorn:~$ 

The only way I know of, to get that list from apt, is by parsing it
out of the output of "apt-cache showpkg".

unicorn:~$ apt-cache showpkg mail-transport-agent | sed -n '/^Reverse Provides/,$p'
Reverse Provides: 
mta-local 1.0 (= )
exim4-daemon-light 4.96-15+deb12u2 (= )
exim4-daemon-heavy 4.96-15+deb12u2 (= )
dma:i386 0.13-1+b1 (= )
ssmtp 2.64-11 (= )
[...]

Which is... better than nothing, admittedly, but it still mystifies me
why this *one* feature is excluded from apt-patterns, when so many others
are included.

[toc] | [prev] | [next] | [standalone]


#262266

FromMax Nikulin <manikulin@gmail.com>
Date2023-10-09 14:20 +0200
Message-ID<HmXoR-eBTt-7@gated-at.bofh.it>
In reply to#262228
On 08/10/2023 01:45, Greg Wooledge wrote:
> On Sat, Oct 07, 2023 at 08:27:11PM +0200, Sven Joachim wrote:
>> In the current case, "aptitude search '~Plsb-base'" does the trick.
> Why on EARTH was this not ported to apt-patterns(7)?

It is one of two features I miss in "apt list".

Another one is --showformat similar to dpkg-query. "apt" is not for 
scripting, but sometimes I do not mind to add package descriptions.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web