[Aptitude-devel] Bug#812444: aptitude: REQUEST: operator to version order test in "aptitude search" query syntax.

Oleksandr Gavenko gavenkoa at gmail.com
Wed Feb 3 23:40:19 UTC 2016

On 2016-02-03, Manuel A. Fernandez Montecelo wrote:

> I think that indeed the way to get this list of newer packages Kali than
> in Debian is using ?upgradable, if pinning of the repositories (man
> apt_preferences) is done correctly and if Kali's versions indeed show
> higher numbers than Debian.  Is this not working properly?
I know about pinning solution. Just keep text short.

This require modifying system files in order to make desired query.

Doing so in chroot environments after debootstrap also looks complicated.

> Another way to get such a list would be to produce a list of packages
> and versions of both Kali an Debian, and post-process it using "dpkg
> --compare-versions".
I think that "python-apt" is better way to do such task because parsing output

  $ aptitude versions '...'
  $ apt-cache policy '...'

isn't pleasure. But I haven't worked with "python-apt".

> In general, I don't know if the requested operator is very useful,
> because aptitude and apt have different concept of how the system should
> work, based on apt pinning.  Packages in Debian experimental or unstable
> might have bigger version numbers than the ones in testing or stable,
> but still the ones in testing and stable used by default, because the
> user prefers to maintain most packages in the stable or testing version.
One important question when you work with mixed sources - what is the

With "?narrow(X,Y)" you get it.

But you don't know how they are different. List of newer/older packages gives
better picture.

But anyway I don't know easy way to display and process list of packages with
versions. "apt-cache policy" output is not in machine readable format.

"aptitude" formatting is not so rich to show several versions for single


I was not aware about formatting issue. I don't need list of packages without
origin/version association.

I think that request should be closed. Any advanced querying should be done
with "python-apt" or other programming interfaces.


More information about the Aptitude-devel mailing list