Zsh does not find uninstalled AUR apps by completion

zsh does not find uinstalled apps of the AUR by completion:
Example:
paru
zsh: correct ‘paru’ to ‘ptar’ [nyae]? n
zsh: command not found: paru
.
cura [127]
zsh: correct ‘cura’ to ‘crda’ [nyae]? n
The application cura is not installed. It may be found in the following packages:
community/cura 4.8.0-1 /usr/bin/cura
Do you want to Install package cura? (y/N)
.

Hi @GaVenga,

I’m guessing there is your problem.

I haven’t got paru installed, and it doesn’t recognize it, either:

$ paru
zsh: correct 'paru' to 'ptar' [nyae]? n
zsh: command not found: paru

Edit:

And I reckon it won’t give any suggestions for possible AUR packages to install, like paru, because the list of possibilities is just to long.

But I might be wrong 'bout this, so don’t take my word for it.

Actually Manjaro terminal is supposed to check pkgfile.
Certainly to ensure pkgfile is up to date, you must do:
pkgfile -u
systemctl enable pkgfile-update.timer

I disabled autocorrect TBH because I’m not keen to have an extra layer of 'did you just type that wrong (ynae)

# setopt correct                   # Auto correct mistakes

The file /usr/share/doc/pkgfile/command-not-found.zsh is also rather relevant here.

But as I say, I am not sure how to enable it in my zsh terminal. I see only the lines:

if [ -f /etc/bash.command-not-found ]; then
    ./etc/bash.command-not-found
fi

To be honest, if I had this issue - I’d just do pamac install paru… but of course, if you’re looking at paru you’ll have yay too, so just yay paru will do.

Pamac is nice - and it doesn’t use sudo either (in case you delete sudo and find out something else doesn’t work).

And that pkgfile doesn’t include the AUR:

$ sudo pkgfile -u                                                                                                                                                                                                        
[sudo] password for mirdarthos:
:: Updating 4 repos...
download complete: multilib             [   262.1 KiB   145K/s  3 remaining]
download complete: core                 [  1577.5 KiB   615K/s  2 remaining]
download complete: extra                [     9.4 MiB  2.34M/s  1 remaining]
download complete: community            [    29.7 MiB  4.04M/s  0 remaining]
:: download complete in 7.36s             <    41.0 MiB  5.57M/s  4 files    >
:: waiting for 1 process to finish repacking repos...
╰─ do pkgfile -u                                                      ─╯
doas (ben@Evo) password:
:: Updating 5 repos...
community is up to date
core is up to date
multilib is up to date
extra is up to date
chaotic-aur is up to date

No need for sudo there :wink:
Apparently I get community and chaotic… disappointing when there’s no AUR, just community would be better IMO.

Check in your profile.

# Offer to install missing package if command is not found
if [[ -r /usr/share/zsh/functions/command-not-found.zsh ]]; then
    source /usr/share/zsh/functions/command-not-found.zsh
    export PKGFILE_PROMPT_INSTALL_MISSING=1
fi

It would work with pamac, so any repo should turn up results.

blender                                                                                                 
The application blender is not installed. It may be found in the following packages:
community/blender 17:2.91.2-3                         /usr/bin/blender
chaotic-aur/blender-git 2.93.r104071.g57c41a9c633-1   /usr/bin/blender
Do you want to Install package blender? (y/N)

And it works with paru too…

paru                                                                                                 ─╯
The application paru is not installed. It may be found in the following packages:
chaotic-aur/paru 1.3.0-1                      /usr/bin/paru
chaotic-aur/paru6alfa-git 1.3.0.r5.g8323cff-1 /usr/bin/paru
Do you want to Install package paru? (y/N)

In paru, don’t forget the config (~/.config/paru) - stuff like 'BottomUp` to get the results similar layout to yay - very nice software (as is yay).

1 Like

Very cool! Thank you!
I’ve come into the bad, I know, habit of doing that kind of thing with sudo. Yeah, I know it can be bad and I’m trying to break the habit. I really am!

1 Like

O.K. there “liegt der Hund begraben:” [That’s the crux of the matter.]
→ pkgfile doesn’t include the AUR:

paru is only an example for the “insufficiency”

I know it’s only an example, that’s why I used it as well. So we can compare apples with apples.

However, it seems to me we are, somehow, miscommunicating and misuderstanding each other. So my apologies, then.

Apples with Oranges btw…

Nope.

I meant apples with apples. The same thing with the same thing. Comparing apples with Oranges is not comparing same things.

1 Like

So Problem this not solved yet:
ZSH not searching the AUR for packages.
===> uses pacman <==> looks not into AUR
.
(output of find-the-command (AUR):
paru
zsh: correct ‘paru’ to ‘ptar’ [nyae]? n
find-the-command: “paru” is not found locally, searching in repositories…
find-the-command: command not found: paru

. Does not work, if added to .zshrc or .profile.
As “chaotic-aur” is not in my /etc/pacman.conf

Yes, I think it should be 1 community and 2 aur

Added this to my /etc/pacman.conf - and it works:
.
[chaotic-aur]
# DE | By: Nico
Server = https://de-1-mirror.chaotic.cx/$repo/$arch

You get AUR results? Or you misread the issue?

We want to type something like Paru and see 1. Community 2. AUR and maybe other options as added.

However, it appears the terminal using pkgfile should only suggest Official repos - that means not AUR and certainly not Chaotic…
We don’t see Aur and that I right (not an official repo) but Cha0tic is??

Yes, if I would add the server adress like “https://[path to the AUR]”
in /etc/pacman.conf it would be treated like a “normal” repo (AFAIK).

Not from the AUR, but: That is because of:
https://wiki.archlinux.org/index.php/unofficial_user_repositories
“The Repo “chotic-aur” contains “most of” the official AUR contents”.

There is the keyring.
.
sudo pkgfile -u
:: Updating 5 repos…
community is up to date
core is up to date
multilib is up to date
extra is up to date
chaotic-aur is up to date