Suggestion for Linux Distro (from PSA: Linux vulnerability)
Roel Schroeven
roel at roelschroeven.net
Fri Mar 11 03:56:05 EST 2022
Op 11/03/2022 om 3:50 schreef Chris Angelico:
> On Fri, 11 Mar 2022 at 09:51, Cousin Stanley <cousinstanley at 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.
--
"Don't Panic."
-- Douglas Adams, The Hitchhiker's Guide to the Galaxy
More information about the Python-list
mailing list