1

I'm trying to list and display some info about available security updates on Ubuntu server.

I would use the following command, where ?archive(security) filters packages that contain security in their archive, while %t shows the archive:

aptitude search "?upgradable ?archive(security)" -F "%p %t %v %V" --disable-columns

I found this issue: in the output, there are packages pertaining to the updates archive as well as to the security archive. See the following excerpt:

xwayland                      xenial-updates
xwayland:i386                 xenial-updates
xwayland-hwe-16.04            xenial-security,xenial-updates
xwayland-hwe-16.04:i386       xenial-security,xenial-updates

Am I making a mistake or missing some understanding of the command or the system?


Note:

As described in the search pattern reference, a search pattern consists of one or more conditions (“terms”), and packages match the pattern if they match all of its terms. Thus, ?upgradable ?archive(security) is equivalent to ?and(?upgradable ?archive(security)).

1 Answer 1

0

You should add ?and to combine both search parameters:

aptitude search "?and(?upgradable ?archive(security))" --disable-columns

3
  • The correct syntax would be aptitude search "?and(?upgradable ?archive(security))" but it yelds the same results anyway, i.e. it includes packages that are just from xenial-updates and not from xenial-security.
    – simlev
    Dec 28, 2018 at 7:42
  • Yes - your syntax should be correct. I'm sorry - I can't test it without a connection to one of my ubuntu servers. Debian uses ?narrow for this... Dec 28, 2018 at 22:31
  • The syntax in this answer should perhaps be corrected, as it currently just produces an error, but in any case I think the answer is wrong. aptitude search "?archive(security)" |grep xwayland would still show the xwayland answer above. Apparently %t in the search formatting does not relate to the ?archive(security) in the aptitude search query in the way that's expected. I haven't yet found the documentation that would explain this.
    – mc0e
    Sep 10, 2019 at 5:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .