Re: Understanding package dependencies

2023-10-09 Thread Max Nikulin

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.




Re: Understanding package dependencies

2023-10-08 Thread Greg Wooledge
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.



Re: Understanding package dependencies

2023-10-08 Thread Jörg-Volker Peetz

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.




Re: Understanding package dependencies

2023-10-07 Thread Greg Wooledge
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)
   ^



Re: Understanding package dependencies

2023-10-07 Thread Sven Joachim
On 2023-10-07 19:24 +0200, Steve Keller wrote:

> Greg Wooledge  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



Re: Understanding package dependencies

2023-10-07 Thread Greg Wooledge
On Sat, Oct 07, 2023 at 07:24:24PM +0200, Steve Keller wrote:
> Greg Wooledge  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)



Re: Understanding package dependencies

2023-10-07 Thread Steve Keller
Greg Wooledge  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



Re: Understanding package dependencies

2023-10-07 Thread Greg Wooledge
On Sat, Oct 07, 2023 at 01:04:56PM +, Michael Kjörling wrote:
> On 7 Oct 2023 13:47 +0200, from keller.st...@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.



Re: Understanding package dependencies

2023-10-07 Thread Michael Kjörling
On 7 Oct 2023 13:47 +0200, from keller.st...@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?”