Re: List packages from non-default repositories

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

Thanks for the detailed inspection. I'll have a closer look into the apt 
abilities.
Regards,
Jörg.




Re: List packages from non-default repositories

2023-10-04 Thread Max Nikulin

On 04/10/2023 15:42, Jörg-Volker Peetz wrote:

$ apt list '~i' | grep -v '/testing'

and

$ apt-show-versions | grep -v '/testing '

show the same packages, correctly, but

$ apt list '~i!~Atesting'

is missing some packages.


It is the reason why I added '?narrow'. Try

   apt list '?any-version(~i!~A^testing)'

For me it is not intuitive that the outer '?any-version()' modifies 
result of the inner '?and()'.


Actually the expression gives *some* upgradable packages in addition, 
but not all of them. For the stable release installed libc6 version is 
available from bookworm/main, but thunderbird-102 has been wiped from 
bookworm-security, so


apt list '?narrow(~i, ~n"^(thunderbird|libc6)$", !~A^stable)'
Listing... Done
thunderbird/stable-security 1:115.3.1-1~deb12u1 amd64 [upgradable from: 
1:102.15.1-1~deb12u1]

N: There are 3 additional versions. Please use the '-a' switch to see them.

skips libc6 however it can be upgraded

apt list '~U~n"^(thunderbird|libc6)$"'
Listing... Done
libc6/stable-security 2.36-9+deb12u3 amd64 [upgradable from: 2.36-9+deb12u1]
thunderbird/stable-security 1:115.3.1-1~deb12u1 amd64 [upgradable from: 
1:102.15.1-1~deb12u1]


It took some time for me to figure out what is the difference.

apt policy libc6 thunderbird
libc6:
  Installed: 2.36-9+deb12u1
  Candidate: 2.36-9+deb12u3
  Version table:
 2.37-10 100
100 http://deb.debian.org/debian trixie/main amd64 Packages
 2.36-9+deb12u3 500
500 http://security.debian.org/debian-security 
bookworm-security/main amd64 Packages

 *** 2.36-9+deb12u1 500
500 http://deb.debian.org/debian bookworm/main amd64 Packages
100 /var/lib/dpkg/status
thunderbird:
  Installed: 1:102.15.1-1~deb12u1
  Candidate: 1:115.3.1-1~deb12u1
  Version table:
 1:115.3.1-1~deb12u1 500
500 http://security.debian.org/debian-security 
bookworm-security/main amd64 Packages

 1:115.2.2-1 100
100 http://deb.debian.org/debian trixie/main amd64 Packages
 *** 1:102.15.1-1~deb12u1 100
100 /var/lib/dpkg/status
 1:102.13.0-1~deb12u1 500
500 http://deb.debian.org/debian bookworm/main amd64 Packages

So either ", !~U" should be added inside "?narrow()" or "| ~U" outside 
of it, depending on desired result in respect to upgradable packages.




Re: List packages from non-default repositories

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

Max Nikulin wrote on 04/10/2023 04:22:

On 04/10/2023 01:29, Jörg-Volker Peetz wrote:

Max Nikulin wrote on 03/10/2023 12:11:

apt list '?narrow(~i, !~Astable|~Astable-backports|!~O^Debian$|~o|~c)'


In my experience the only tool that gives correct answers, is 
apt-show-versions in the package of the same name:


$ apt-show-versions | grep -v '/stable '


Thanks.

Do you have an example of a case when apt-show-versions works better when the 
following command?


   apt list '~i' | grep -Ev '[/,]stable(-updates|-security)?,'



I have to add that I'm working on a system from the testing archive with 
unstable and experimental archives also available.


Indeed the commands

$ apt list '~i' | grep -v '/testing'

and

$ apt-show-versions | grep -v '/testing '

show the same packages, correctly, but

$ apt list '~i!~Atesting'

is missing some packages.

Regards,
Jörg.



Re: List packages from non-default repositories

2023-10-04 Thread Max Nikulin

On 04/10/2023 11:58, David Wright wrote:

Explanations for these hits:
   linux-image is the previous kernel,
   xtoolwait is from squeeze,
   youtube-dl is the last I found before I started using yt-dlp,
   and I don't have backports in my sources.list.


Besides youtube-dl, these packages should be reported by

   apt list '~o'

In my cases '~o' was inapplicable since packages are available from 
configured repositories. At certain moment (after reinstalling 
libstdc++6 and removing gcc-13-base) my list was

  elpa-org/testing,now 9.6.9+dfsg-1 all [installed]
  libnss3/testing,now 2:3.92-1 amd64 [installed,automatic]
  libx11-6/testing,now 2:1.8.6-1 amd64 [installed,automatic]
  libx11-xcb1/testing,now 2:1.8.6-1 amd64 [installed,automatic]
  linux-image-6.4.0-0.deb12.2-amd64/stable-backports,now 
6.4.4-3~bpo12+1 amd64 [installed,automatic]


I have realized that in my original command '~o' may be omitted, '~c' 
was added at a wrong place. In comparison to "apt list '~i'" or 
apt-show-versions + grep it had additional feature (or bug). It listed 
upgradable packages. So my current pattern to get package candidates for 
clean-up is (for oldstable)


  apt list '?narrow(~i, 
!~A^oldstable|~A^oldstable-backports|!~O^Debian$, !~U) | ~c | ~b'




Re: List packages from non-default repositories

2023-10-03 Thread David Wright
On Wed 04 Oct 2023 at 09:22:06 (+0700), Max Nikulin wrote:
> On 04/10/2023 01:29, Jörg-Volker Peetz wrote:
> > Max Nikulin wrote on 03/10/2023 12:11:
> > > apt list '?narrow(~i, !~Astable|~Astable-backports|!~O^Debian$|~o|~c)'
> > 
> > In my experience the only tool that gives correct answers, is
> > apt-show-versions in the package of the same name:
> > 
> > $ apt-show-versions | grep -v '/stable '
> 
> Thanks.
> 
> Do you have an example of a case when apt-show-versions works better
> when the following command?
> 
>   apt list '~i' | grep -Ev '[/,]stable(-updates|-security)?,'
> 
> OK, it issues a warning
> 
> WARNING: apt does not have a stable CLI interface. Use with caution in
> scripts.
> 
> In my case apt list + grep  gives the same packages as "apt list" with
> the pattern I posted.

  $ apt-show-versions | grep -v '/bullseye'
  linux-image-5.10.0-24-amd64:amd64 5.10.179-5 installed: No available version 
in archive
  xtoolwait:amd64 1.3-6.2 installed: No available version in archive
  youtube-dl:all 2021.12.17-1~bpo11+1 newer than version in archive
  yt-dlp:all 2023.07.06-1~bpo12+1 installed: No available version in archive
  $ apt list '~i' | grep -Ev '[/,]oldstable(-updates|-security)?,'

  WARNING: apt does not have a stable CLI interface. Use with caution in 
scripts.

  Listing...
  linux-image-5.10.0-24-amd64/now 5.10.179-5 amd64 [installed,local]
  xtoolwait/now 1.3-6.2 amd64 [installed,local]
  youtube-dl/now 2021.12.17-1~bpo11+1 all [installed,local]
  yt-dlp/now 2023.07.06-1~bpo12+1 all [installed,local]
  $ 

So just a little more information in the first.

Explanations for these hits:
  linux-image is the previous kernel,
  xtoolwait is from squeeze,
  youtube-dl is the last I found before I started using yt-dlp,
  and I don't have backports in my sources.list.

Cheers,
David.



Re: List packages from non-default repositories

2023-10-03 Thread Max Nikulin

On 04/10/2023 01:29, Jörg-Volker Peetz wrote:

Max Nikulin wrote on 03/10/2023 12:11:

apt list '?narrow(~i, !~Astable|~Astable-backports|!~O^Debian$|~o|~c)'


In my experience the only tool that gives correct answers, is 
apt-show-versions in the package of the same name:


$ apt-show-versions | grep -v '/stable '


Thanks.

Do you have an example of a case when apt-show-versions works better 
when the following command?


  apt list '~i' | grep -Ev '[/,]stable(-updates|-security)?,'

OK, it issues a warning

WARNING: apt does not have a stable CLI interface. Use with caution in 
scripts.


In my case apt list + grep  gives the same packages as "apt list" with 
the pattern I posted.





Re: List packages from non-default repositories

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

Max Nikulin wrote on 03/10/2023 12:11:

apt list '?narrow(~i, !~Astable|~Astable-backports|!~O^Debian$|~o|~c)'


In my experience the only tool that gives correct answers, is apt-show-versions 
in the package of the same name:


$ apt-show-versions | grep -v '/stable '

Beware, that it works with a database which should be updated before asking 
something.


Regards,
Jörg.