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)).

simlev
  • 1,105
  • 3
  • 14
  • 22

1 Answers1

0

You should add ?and to combine both search parameters:

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

Andreas Rehm
  • 851
  • 6
  • 11
  • 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 '18 at 07: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... – Andreas Rehm Dec 28 '18 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 '19 at 05:14