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.