On Fri, 11 Mar 2022 at 19:57, Roel Schroeven <r...@roelschroeven.net> wrote: > > Op 11/03/2022 om 3:50 schreef Chris Angelico: > > On Fri, 11 Mar 2022 at 09:51, Cousin Stanley <cousinstan...@gmail.com> > > wrote: > > > The following will display a list of lxqt packages > > > that are in the repository and available to install .... > > > > > > apt-cache search lxqt | grep ^lxqt > > > > > Much faster: > > > > apt-cache pkgnames lxqt > > > > (apt-cache search will look for "lxqt" in descriptions too, hence the > > need to filter those out - apt-cache pkgnames is used by tab > > completion) > > > Cousing Stanley's suggestion has the advantage that it also prints the > short descriptions instead of just the package names. The packages names > are often a bit too cryptic, I think. > > To search only in package names but still show the short description you > could also --names-only instead of grep: > > apt-cache search --names-only lxqt > > or > > apt-cache search --names-only ^lxqt > > Chris, when you say "Much faster", do you mean faster to type or faster > to execute? Your suggestion is certainly faster and easier to type. But > as for execution speed: on my systems apt-cache search is fast enough > that I don't really care about its execution time. When listing packages > that is; tab completion is a different matter, where every delay can be > quite annoying.
Notably faster to execute on my system. Maybe the difference is insignificant on yours, but it's highly unlikely to be *slower*. The speed difference probably depends on how many package repositories you have, whether you have source packages, etc, etc, etc. (And of course, whether it's on a hard drive or SSD.) And what I would *actually* type is "apt i<tab> lxqt<tab><tab>", so it's quite a lot faster. (I actually had to look up the precise command.) ChrisA -- https://mail.python.org/mailman/listinfo/python-list