#902536 Document how to detect 'newer than in the archive' installed packages

Package:
aptitude
Source:
aptitude
Description:
terminal-based package manager
Submitter:
積丹尼 Dan Jacobson
Date:
2019-10-02 18:27:05 UTC
Severity:
wishlist
#902536#5
Date:
2018-06-27 14:09:40 UTC
From:
To:
Aptitude's "~o" search string is not good enough.

It doesn't catch cases like in Bug #902503.

For such cases one needs

# aptitude -F '%t %p' search ~i!~o|perl -nwle 'print if s/^now //;'
firefox
libffi6

That's the only way one is going to find them.

# aptitude -F '%t %p' search ~i!~o|perl -nwle 'print if s/^now //;'|xargs apt-cache policy
firefox:
  Installed: 61.0~b8-1
  Candidate: 61.0~b8-1
  Version table:
 *** 61.0~b8-1 100
        100 /var/lib/dpkg/status
     60.0.2-2 500
        500 http://free.nchc.org.tw/debian unstable/main amd64 Packages
libffi6:
  Installed: 3.3~20160224-1
  Candidate: 3.3~20160224-1
  Version table:
 *** 3.3~20160224-1 100
        100 /var/lib/dpkg/status
     3.2.1-8 500
        500 http://free.nchc.org.tw/debian unstable/main amd64 Packages

So aptitude needs a new ~ search term, like ~o, but for packages in the
$ apt-show-versions | grep newer
firefox:amd64 61.0~b8-1 newer than version in archive
libffi6:amd64 3.3~20160224-1 newer than version in archive
state.

Or at least add my example to the aptitude manual. I'm sure one would
want to detect such packages.

MB> You have an outdated libffi6 version installed from experimental.
MB> Please update to the version from sid.
MB> This is a duplicate of
MB> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902411

#902536#10
Date:
2018-06-27 14:24:51 UTC
From:
To:
Hi Jidanni,

積丹尼 Dan Jacobson wrote:

This can be done with pure aptitude pattern matching, i.e. also
interactively and without needing shell pipes:

→ which aptitude-newer-than-in-archive
aptitude-newer-than-in-archive: aliased to aptitude -o "Aptitude::Pkg-Display-Limit=~i ?any-version(!~O.) !~U !~o"

There is the idea to provide a bunch of example shell scripts like the
one (still an alias here) above.

Your bug report assures me that there is some demand for such a set of
aptitude example scripts.

		Regards, Axel

#902536#19
Date:
2018-06-27 14:33:48 UTC
From:
To:
AB> aptitude-newer-than-in-archive: aliased to aptitude -o "Aptitude::Pkg-Display-Limit=~i ?any-version(!~O.) !~U !~o"
All I know is
# aptitude -o Aptitude::Pkg-Display-Limit=~i search '?any-version(!~O.) !~U !~o'|head
v  a52dec -
v  a52dec-dev -
v  aac-tactics -
v  aalib-bin -
v  aalib1 -
v  acl-dev -
v  acpi-call -
v  acpidump -
v  adblock-plus -
v  adblock-plus-element-hiding-helper -

P.S., I hope your scripts will have non GUI versions too.

#902536#24
Date:
2018-06-27 16:07:56 UTC
From:
To:
Hi Jidanni,

積丹尼 Dan Jacobson wrote:

You ignored the double quotes. Try it like this:

~ → aptitude search '~i ?any-version(!~O.) !~U !~o'
i A links              - Web browser running in text mode
i   links-dbgsym       - debug symbols for links
i A links2             - Web browser running in both graphics and text mode
i   links2-dbgsym      - debug symbols for links2
i A screen             - terminal multiplexer with VT100/ANSI terminal emulation
i   screen-dbgsym      - debug symbols for screen
i   zsh                - shell with lots of features
i A zsh-common         - architecture independent files for Zsh
i   zsh-dbgsym         - debug symbols for zsh
i   zsh-dev            - shell with lots of features (development files)
i A zsh-doc            - zsh documentation - info/HTML format
i   zsh-static         - shell with lots of features (static link)
i   zsh-static-dbgsym  - debug symbols for zsh-static

Might still have some false positives, compared to apt-show-versions:

~ → apt-show-versions | fgrep newer
links:amd64 2.15-1 newer than version in archive
links-dbgsym:amd64 2.15-1 newer than version in archive
links2:amd64 2.15-1 newer than version in archive
links2-dbgsym:amd64 2.15-1 newer than version in archive

~ → apt-cache policy screen zsh
screen:
  Installed: 4.6.2-1+b1
  Candidate: 4.6.2-1+b1
  Version table:
     4.6.2-2~20180402224407.147 500
        500 https://jenkins.grml.org/debian screen/main amd64 Packages
     4.6.2-1+b1wtf1 250
        250 https://www.mirbsd.org/~tg/Debs sid/wtf amd64 Packages
 *** 4.6.2-1+b1 990
        990 https://debian.ethz.ch/debian sid/main amd64 Packages
        600 https://debian.ethz.ch/debian testing/main amd64 Packages
        100 /var/lib/dpkg/status
zsh:
  Installed: 5.5.1-1+b1
  Candidate: 5.5.1-1+b1
  Version table:
 *** 5.5.1-1+b1 990
        990 https://debian.ethz.ch/debian sid/main amd64 Packages
        600 https://debian.ethz.ch/debian testing/main amd64 Packages
        100 /var/lib/dpkg/status
     5.5.1-1+0~20180417015621.399~1.gbp0bb292 500
        500 https://jenkins.grml.org/debian zsh/main amd64 Packages

Will probably have to update and finetune these patterns.

So far not, but you are currently changing that. :-)

		Regards, Axel

#902536#29
Date:
2018-06-27 16:15:47 UTC
From:
To:
Hmmm, looks complex.
Sure hope you also mention "or just use apt-show-versions ...".