RetroFed Forums
Your home away from modern life.
How to avoid Rust spam in package searches?
Post Reply
AuthorMessage
lambalicious
lemmy.sdf.org
lambalicious@lemmy.sdf.org
Joined: 2023-07-26
Posted:   Subject: How to avoid Rust spam in package searches? Quote

Use case:

Start aptitude, search for foobar (/, foobar).

Start iterating through the list of packages found until somehow, someday, you can find something that is actually about foobar and not about Rust:

librust-foobar-bindings-0.19-a-git-dev
librust-foobar-bindings-0.19-b-git-dev
librust-foobar-bindings-0.19-c-git-dev
librust-foobar-bindings-0.19-c-git-latest-dev
librust-foobar-bindings-0.19-d-preview-dev
librust-foobar-bindings-0.20-a-git-dev
librust-foobar-bindings-0.21-a-release-dev
librust-foobar-bindings-0.21-b-hotfix-dev
librust-foobar-bindings-0.22-a-morecrap-dev
librust-foobar-graphics-0.19
librust-foobar-graphics-0.19-b
librust-foobar-graphics-0.19-c
librust-foobar-graphics-0.19-c-latest
librust-foobar-graphics-0.19-d
librust-foobar-graphics-0.20
librust-foobar-graphics-0.21
librust-foobar-graphics-0.21-hotfix
librust-foobar-graphics-0.22
librust-foobar-enums-0.19
librust-foobar-enums-0.20
librust-foobar-enums-0.21
librust-foobar-enums-0.22
librust-gstreamer-foobar-0.19
librust-gstreamer-foobar-0.20
librust-gstreamer-foobar-0.21
librust-gstreamer-foobar-0.22
librust-foobar-0.19-doc
librust-foobar-0.20-doc
librust-foobar-0.21-doc
librust-foobar-0.22-doc
librust-linter-foobar-0.19
librust-linter-foobar-0.19-a
librust-linter-foobar-0.19-b
librust-linter-foobar-0.19-c
librust-linter-foobar-0.19-c-latest
librust-linter-foobar-0.19-d
librust-linter-foobar-0.20
librust-linter-foobar-0.21-release
librust-linter-foobar-0.21-hotfix
librust-linter-foobar-0.22-morecrap
librust-abecedary-foobar-a
librust-abecedary-foobar-b
librust-abecedary-foobar-c
librust-abecedary-foobar-d
librust-abecedary-foobar-e
librust-abecedary-foobar-f
librust-abecedary-foobar-g
librust-abecedary-foobar-h
librust-abecedary-foobar-i
librust-abecedary-foobar-j
librust-abecedary-foobar-k
librust-abecedary-foobar-l
librust-abecedary-foobar-m
librust-abecedary-foobar-n
librust-abecedary-foobar-o
librust-abecedary-foobar-p
librust-abecedary-foobar-q
librust-abecedary-foobar-r
librust-abecedary-foobar-s
librust-abecedary-foobar-t
librust-abecedary-foobar-u
librust-abecedary-foobar-v
librust-abecedary-foobar-w
librust-abecedary-foobar-x
librust-abecedary-foobar-y
librust-abecedary-foobar-z
[...241 iterations later...]
librust-zstd-handler-foobar-0.19
librust-zstd-handler-foobar-0.20
librust-zstd-handler-foobar-0.21
librust-zstd-handler-foobar-0.22
foobar
foobar-data
glx-alternative-foobar
gtk-theme-foobar
foobar-mime-types

Any practical way of ridding of this spam in tools like apt or aptitude?

2   Original
Salsa5924
lemmy.world
Salsa5924@lemmy.world
Joined: 2023-08-06
#2 Posted:   Subject: Re: How to avoid Rust spam in package searches? Quote Reply

Apt search support regex

search (apt-cache(8))
search can be used to search for the given regex(7) term(s) in the list of available packages and display matches. This can e.g. be useful if you are looking for packages having a specific feature. If you are looking for a package including a specific file try apt-file(1).

3
Brickfrog
lemmy.dbzer0.com
brickfrog@lemmy.dbzer0.com
Joined: 2023-06-13
#3 Posted:   Subject: Re: How to avoid Rust spam in package searches? Quote Reply

Apt search support regex search (apt-cache(8)) search can be used to search for the given regex(7) term(s) in the list of available packages and display matches. This can e.g. be useful if you are looking for packages having a specific feature. If you are looking for a package including a specific file try apt-file(1).

Just to add to your answer, regular apt search will find all search keywords in the package name and description so OP may still have a ton of output in the search results. It may be helpful to narrow down the search to just the package name e.g.

apt search --names-only blahblah

It still accepts regex so something like

apt search --names-only ^blahblah

would find all packages with names beginning with "blahblah". The ^ regex specifies the beginning of the word being searched rather than searching anywhere within the package name (for the ppl not too versed in regex syntax).

One thing that confused me, the manpage for apt on my Debian system doesn't even mention "--names-only" so I'm not sure where that's documented officially.. I found it online and discovered it works in Debian Trixie.

2
Post Reply
Back to top