Look for packages only by name

I know, this should be easy, but I am struggling with this for a while.

I like to simply look for packages by their name only.
By default, pacman looks for the description as well.

The Arch Wiki is outright lying about this:

Sometimes, -s’s (…) can cause a lot of unwanted results, so it has to be limited to match the package name only; not the description nor any other field:

$ pacman -Ss '^vim-'

That goes overboard, and limits the output to exact matches:

Paru is no better.

Ideally, I am looking for a command, that does:

  1. Look up for the string in all package names.
  2. Does so for both AUR and normal repositories.

doesn’t yay <packagename> works for you ? :slightly_smiling_face:

 ╭─ankur@ankur in ~ took 8s
[🧱] × yay linux zen
50 aur/linux-zen-bmq-headers 6.4.0.zen1-1 [+0 ~0.00]
    Headers and scripts for building modules for the linux-zen-bmq kernel
49 aur/linux-zen-bmq 6.4.0.zen1-1 [+0 ~0.00]
    The Zen kernel and modules - BMQ enabled
48 aur/linux-zen-bcachefs-git-headers v5.10.27.zen1.r971607.feeca9682c64-1 [+0 ~0.00] [Out-of-date: 2022-11-10]
    Headers and scripts for building modules for the Linux ZEN with bcachefs kernel
47 aur/linux-zen-bcachefs-git-docs v5.10.27.zen1.r971607.feeca9682c64-1 [+0 ~0.00] [Out-of-date: 2022-11-10]
    Documentation for the Linux ZEN with bcachefs kernel
46 aur/linux-zen-bcachefs-git v5.10.27.zen1.r971607.feeca9682c64-1 [+0 ~0.00] [Out-of-date: 2022-11-10]
    The Linux ZEN with bcachefs kernel and modules
45 aur/linux-zen-515lts-headers 5.15.74.r0.ga3f2f5ac9d61-1 [+0 ~0.00]
    Headers and scripts for building modules for the Linux (Git) kernel
44 aur/linux-zen-515lts 5.15.74.r0.ga3f2f5ac9d61-1 [+0 ~0.00]
    The Linux (Git) kernel and modules
43 aur/linux-rangho-headers 6.4.7.rangho1-1 [+0 ~0.00]
    Headers and scripts for building modules for the Linux ZEN with RangHo's local patches 
    kernel
42 aur/linux-rangho-docs 6.4.7.rangho1-1 [+0 ~0.00]
    Documentation for the Linux ZEN with RangHo's local patches kernel
41 aur/linux-rangho 6.4.7.rangho1-1 [+0 ~0.00]
    The Linux ZEN with RangHo's local patches kernel and modules
40 aur/zenergy-dkms-git 21.09f4d2f-1 [+1 ~0.28]
    Linux kernel driver for reading RAPL registers for AMD Zen CPUs
39 aur/linux-zen-pds-headers 6.4.0.zen1-1 [+1 ~0.21]
    Headers and scripts for building modules for the linux-zen-pds kernel
38 aur/linux-zen-pds 6.4.0.zen1-1 [+1 ~0.21]
    The Zen kernel and modules - PDS enabled
37 aur/zfs-linux-zen-git-headers 2020.03.31.r5836.g0929c4de3_5.5.13.zen2.1-1 [+2 ~0.12] [Out-of-date: 2021-04-16] [Orphaned]
    Kernel headers for the Zettabyte File System.
36 aur/zfs-linux-zen-git 2020.03.31.r5836.g0929c4de3_5.5.13.zen2.1-1 [+2 ~0.12] [Out-of-date: 2021-04-16] [Orphaned]
    Kernel modules for the Zettabyte File System.
35 aur/linux-zencjk-headers 6.5.2.zen1-1 [+2 ~1.08]
    Headers and scripts for building modules for the Linux ZEN (with cjktty patch) kernel
34 aur/linux-zencjk 6.5.2.zen1-1 [+2 ~1.08]
    The Linux ZEN (with cjktty patch) kernel and modules
33 aur/zenpower3-dkms-git 69.c176fdb-1 [+3 ~0.00]
    Linux kernel driver for reading sensors for AMD Zen family CPUs
32 aur/linux6.5.4.zen2-1-zen-headers-bin 6.5.4.zen2-1 [+3 ~0.00]
    Headers and scripts for building modules for the Linux ZEN kernel 6.5.4-zen2-1-zen
31 aur/linux6.5.4.zen2-1-zen-docs-bin 6.5.4.zen2-1 [+3 ~0.00]
    Documentation for the Linux ZEN kernel 6.5.4-zen2-1-zen
30 aur/linux6.5.4.zen2-1-zen-bin 6.5.4.zen2-1 [+3 ~0.00]
    The Linux ZEN kernel and modules, version 6.5.4-zen2-1-zen
29 aur/linux-zen-versioned-headers-bin 6.5.4.zen2-1 [+3 ~0.00]
    Metapackage depending on linux6.5.4.zen2-1-zen-headers-bin
28 aur/linux-zen-versioned-docs-bin 6.5.4.zen2-1 [+3 ~0.00]
    Metapackage depending on linux6.5.4.zen2-1-zen-docs-bin
27 aur/linux-zen-versioned-bin 6.5.4.zen2-1 [+3 ~0.00]
    Metapackage depending on linux6.5.4.zen2-1-zen-bin
26 aur/arch-sign-modules 0.6.4-0 [+4 ~1.42]
    Signed (In Tree & Out of Tree) Kernel Modules for linux linux-lts linux-hardened linux-zen
    + AUR kernels
25 aur/lug-helper 1:2.10.1-1 [+6 ~0.99]
    Star Citizen's Linux Users Group Helper Script
24 aur/linux-amd-znver3 6.5.v.5-1 [+6 ~1.56]
    Linux kernel aimed at the znver3 AMD Ryzen CPU based hardware
23 aur/zenpower-dkms-git 46.5e2f56f-1 [+11 ~0.00] [Out-of-date: 2023-04-20]
    Linux kernel driver for reading sensors for AMD Zen family CPUs
22 aur/zfs-linux-zen-headers 2.1.13_6.5.5.zen1.1-1 [+12 ~1.12]
    Kernel headers for the Zettabyte File System.
21 aur/zfs-linux-zen 2.1.13_6.5.5.zen1.1-1 [+12 ~1.12]
    Kernel modules for the Zettabyte File System.
20 aur/ryzen_smu-dkms-git 152.913683d-1 [+13 ~1.01]
    A Linux kernel driver that exposes access to the SMU (System Management Unit) for certain
    AMD Ryzen Processors
19 aur/zenpower-dkms 0.1.12-2 [+14 ~0.00]
    Linux kernel driver for reading sensors for AMD Zen family CPUs
18 aur/linux-amd-znver2 6.5.v.5-1 [+15 ~0.68]
    Linux kernel aimed at the znver2 AMD Ryzen CPU based hardware
17 aur/linux-zen-git-headers 6.4.10+1189592+gcc866abe3fdd-1 [+29 ~0.04]
    Featureful kernel including various new features, code and optimizations to better suit 
    desktops
16 aur/linux-zen-git 6.4.10+1189592+gcc866abe3fdd-1 [+29 ~0.04]
    Featureful kernel including various new features, code and optimizations to better suit 
    desktops
15 aur/linux-amd-headers 6.5.v.5-2 [+30 ~0.51]
    Header files and scripts for building modules for Linux kernel aimed at the ZNVER4/MZEN4 
    AMD CPU based hardware
14 aur/linux-amd 6.5.v.5-2 [+30 ~0.51]
    Linux kernel aimed at the ZNVER4/MZEN4 AMD Ryzen CPU based hardware
13 aur/zenpower3-dkms 0.2.0-3 [+33 ~2.64]
    Linux kernel driver for reading sensors for AMD Zen family CPUs
12 chaotic-aur/zenpower3-dkms 0.2.0-3.1 [9.40KiB 20.80KiB]
    Linux kernel driver for reading sensors for AMD Zen family CPUs
11 chaotic-aur/zenpower-dkms-git 46.5e2f56f-1.2 [17.21KiB 38.81KiB]
    Linux kernel driver for reading sensors for AMD Zen family CPUs
10 chaotic-aur/zenpower-dkms 0.1.12-2 [8.68KiB 17.35KiB]
    Linux kernel driver for reading sensors for AMD Zen family CPUs
 9 chaotic-aur/ryzen_smu-dkms-git 162.e61177d-1 [36.85KiB 103.00KiB]
    A Linux kernel driver that exposes access to the SMU (System Management Unit) for certain
    AMD Ryzen Processors
 8 chaotic-aur/nvidia-zen 535.113.01.2+6.5.5.zen1.1-1 [43.71MiB 43.71MiB]
    NVIDIA drivers for linux
 7 chaotic-aur/linux-amd-znver3 6.5.v.5-1 [81.47MiB 127.73MiB]
    Linux kernel aimed at the znver3 AMD Ryzen CPU based hardware
 6 chaotic-aur/linux-amd-znver2 6.5.v.5-1 [81.14MiB 127.38MiB]
    Linux kernel aimed at the znver2 AMD Ryzen CPU based hardware
 5 chaotic-aur/linux-amd-headers 6.5.v.5-2 [14.87MiB 58.28MiB]
    Header files and scripts for building modules for Linux kernel aimed at the ZNVER4/MZEN4 
    AMD CPU based hardware
 4 chaotic-aur/linux-amd 6.5.v.5-2 [85.10MiB 131.41MiB]
    Linux kernel aimed at the ZNVER4/MZEN4 AMD Ryzen CPU based hardware
 3 extra/linux-zen-headers 6.5.5.zen1-1 [25.40MiB 125.26MiB]
    Headers and scripts for building modules for the Linux ZEN kernel
 2 extra/linux-zen-docs 6.5.5.zen1-1 [24.08MiB 199.69MiB]
    Documentation for the Linux ZEN kernel
 1 extra/linux-zen 6.5.5.zen1-1 [131.94MiB 132.11MiB]
    The Linux ZEN kernel and modules
:: Packages to install (eg: 1 2 3, 1-3):
:: 

searcheing from aur and whatever repos I have included in my system :wink:

1 Like

This is the default behavior of Pacseek.

I’m not sure if you can get a result like this directly from Pacman or Paru without using a full-on script like this:

[SOLVED] search just package name (not description) with yaourt / Newbie Corner / Arch Linux Forums

OK. This thread is old, but the problem has remained.
Here is my solution:

search_in_AUR_byname:

#!/bin/bash

yaourt --color -Ss $1 | {
	found=0
	while IFS= read -r line; do
		if egrep -qv "^.\[0m    " <<< "$line"; then
			if egrep -q $1 <<< "$line"; then
				echo -e "$line"
				found=1
			else 	found=0
			fi
		elif [ $found -eq 1 ]; then echo -e "$line"
		fi
	done
}

Edit:

I am not in front of a computer to test, but it just occurred to me that you could use -q to output a list of packages without the description, then grep against the list.

paru -Ssq <search term> | grep <search term>

Edit 2:

Yep, it works.

❯ paru -Ssq gpgme | grep gpgme
qgpgme-git
python2-pygpgme-rshk-git
python-pygpgme-rshk-git
python-pygpgme
python-gpgme-git
gpgme-git
ruby-gpgme-1
gpgme-python-git
ruby-gpgme
qgpgme-qt6
qgpgme-qt5
python-gpgme
gpgme

Actually, it seems to work with grep even without -q. :thinking:

❯ paru -Ss gpgme | grep gpgme
aur/qgpgme-git 1.22.0.r11.g8fde9cbe-1 [+0 ~0.00]
aur/python2-pygpgme-rshk-git r18.6c7566b-4 [+0 ~0.00]
    A Python interface to the gpgme GnuPG library (rshk fork)
aur/python-pygpgme-rshk-git r18.6c7566b-4 [+0 ~0.00]
    A Python interface to the gpgme GnuPG library (rshk fork)
aur/python-pygpgme 0.3-10 [+0 ~0.00] [Orphaned]
    A Python interface to the gpgme GnuPG library
aur/python-gpgme-git 1.22.0.r11.g8fde9cbe-1 [+0 ~0.00]
    PHP extension for gnupg/gpgme.
aur/gpgme-git 1.22.0.r11.g8fde9cbe-1 [+0 ~0.00]
    Encrypted network tunneling using salsa20 from libnettle and GPG from libgpgme
aur/ruby-gpgme-1 1.0.8-1 [+1 ~0.00]
aur/gpgme-python-git gpgme.1.9.0.r75.gbd5d470c-1 [+1 ~0.00]
    PHP extension for gnupg/gpgme.
extra/ruby-gpgme 2.0.22-1 [3.33MiB 3.70MiB]
    A graphical front-end to GnuPG(GPG) using the GTK3 toolkit and libgpgme
core/qgpgme-qt6 1.22.0-1 [267.36KiB 1.13MiB]
core/qgpgme-qt5 1.22.0-1 [242.03KiB 1.02MiB]
core/python-gpgme 1.22.0-1 [257.08KiB 1.66MiB]
core/gpgme 1.22.0-1 [0B 1.47MiB] [Installed]
3 Likes

Nope. :slight_smile:

Use it with nteract, as an example.

Interesting. I somehow missed this tool. It looks by default into bash (not the fish shell, I launched it from.) Due to that, does it require yay, as it doesnt pick up our yay to paru binding.

Anyway, great heads up. I will launch an issue on Github, once my lazy ass gets 2FA working :stuck_out_tongue:

I would be fine with a full script like this. Although I would translate it to fish, and I feel like its absurd, to start scripting for such a basic functionality.

That seems to work. It just ruins the beautiful output, that I am used from paru and pacman.

Try it with nteract. It also shows descriptions.
Still, much appreciated! :slight_smile:

It is written in Go, not Bash (I might be misunderstanding you). If you want to use it to install, uninstall, or update it defaults to using yay but you can change it to use Paru or even makepkg if you’d like: Configuration · moson-mo/pacseek Wiki · GitHub

Hit Ctrl+S to get to the settings where you can change that.

Other helpful keybindings (for sorting options, resizing the windows, upgrading) can be found here:

2 Likes

It reaches out to bash. I dont have yay installed, and it reports me that within a bash session.
The fish config has an alias for yay to paru, so that wouldnt happen there.

Oh, wonderful, thanks. I wonder if we could add a variant to the AUR and chaotic, that defaults to paru, or simply add it to Garuda by default? It seems useful.

Thanks a lot!

No, I don’t believe it does. Where are you seeing that?

The yay=paru alias is set in the default .bashrc as well, so you shouldn’t be getting this unless you changed or removed your .bashrc. https://gitlab.com/garuda-linux/themes-and-settings/settings/garuda-bash-config/-/blob/main/bashrc?ref_type=heads

Regardless, when a command is run from within a script or another program, it often runs in a subshell or a separate process, and it might not inherit the same environment and aliases as the interactive shell in your terminal. So even if the alias is properly set up it is possible Pacseek will not honor it.

It should be simple enough to add a custom ~/.config/pacseek/config.json to /etc/skel with the helper set to Paru, that is a good idea.

Edit:

Done!

2 Likes

In its output.

Screenshot_20231005_160523
Command not found

Only since the 20 of May: https://gitlab.com/garuda-linux/themes-and-settings/settings/garuda-bash-config/-/commit/02fb7a05aa1b52902d46f979ebce6fb0da06e781

Is this before, or after the current ISO? Seems damn close.
I dont have it, at least. And I installed with the May release.

You’re welcome and thanks a lot :smiley:

1 Like

Pacseek is just using whatever shell you have set. See for yourself:

echo $SHELL

If you set your shell to Fish, then Pacseek will use Fish.

image

2 Likes

I always forget, that Garuda is set to bash by default, but the default interactive shell is fish somehow. ^-^

Thanks

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.