Skip to content

recommendation: start using pacman, yay and paru with fzf.

if you don't know already you can make fzf search through aur and pacman database with a nice preview of package details. its super comfy for me especially searching packages in aur.

i alias them to pacfind and yayfind.

pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S

paru -Slq | fzf --multi --preview 'paru -Si {1}' | xargs -ro paru -S

pacman -Slq | fzf --multi --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' | xargs -ro sudo pacman -S

you can also make one to remove packages from your system.

source
https://wiki.archlinux.org/title/Fzf#Arch_specific_fzf_uses

Edited 16 May 2021. We only hold this version.

279 points24 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
279 · 97% up
Kind
Text
ID
ndduvm

Author

4
posts
124
comments
0
media
View profile

30 comments

This is my version, based on a similar Manjaro script:

paru -Sl | awk '{print $2($4=="" ? "" : " *")}' | sk --multi --preview 'paru -Si {1}' --reverse | xargs -ro paru -S

I use sk instead of fzf here, but they're largely the same. The awk part puts an asterisk after the names of packages you've already installed.

42 points

To also allow reinstalling packages:

paru -Sl | awk '{print $2($4=="" ? "" : " *")}' | sk --multi --preview 'paru -Si {1}' | cut -d " " -f 1 | xargs -ro paru -S
12 points

for others that may want to add this to their profile files

parufind () {
        paru -Sl | awk '{print $2($4=="" ? "" : " *")}' | fzf --multi --preview 'po:aru -Si {1}' | cut -d \" \" -f 1 | xargs -ro paru -S
}
alias yayfind="parufind"

At least that was the easiest way I found. One thing I don't like is that hitting enter on nothing hangs instead of exiting.

5 points

If you don't mind my asking, what's the point? I'm don't understand what's the use case here.

25 points

not much but sometimes when you don't remember the exact package name you can use fuzzy completion to easily find it without opening browser. also major benefit at least for me is i can see the aur package build date and other details like this without opening a browser.

27 points

​

I just now used the first one to explore optional dependencies.

3 points
unknown author1 hidden

Deleted before we saved it.

7 points

I really like these, listing the package contents is a nice touch.

1 points

Not quite for me, but just finding out about -Slq and -Qq greatly simplified my bash_completion file, so thank you for that. lol

7 points

I combined a bunch of variations from this thread:

parufind () {paru -Sl | awk '{print $2($4=="" ? "" : " \*")}' | fzf -q "$1" -m --preview 'cat <(echo {1} | cut -d " " -f 1 | paru -Si -) <(echo {1} | cut -d " " -f 1 | paru -Fl - | awk "{print $2}")' | cut -d " " -f 1 | xargs -ro paru -S}

with this you can either parufind on all packages, or parufind zsh to open it with the query set to zsh right away.

4 points

Just a noob question. How to create alias?

3 points

Well a bit the wrong place for this question but anyway:

alias please="sudo"

Keep in mind you need to have no spaces between name="...

In between the "" you can use other aliases and Parameters to the command you want to alias

alias ImGroot="please su"

And then you can use it like this: ImGroot echo I'm root!

You can write this into your .bashrc or whatever shell you use so you dont need to retype them manually

(This is a bad example)

4 points

IIRC, sudo is quirky. You may need to also create a separate alias for sudo itself for that to work:

alias sudo="sudo"

A better example is the common ll alias:

alias ll="ls -l"
3 points

eg : if you want to alias sudo pacman -Syu to update
add
alias update="sudo pacman -Syu" to your shell's rc file

2 points
unknown author

Deleted before we saved it.

1 points

alias pacfind="pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S"

1 points

So this hits aur for every single keystroke. I suppose if you use it sparingly it's not that bad.

3 points

afik -Si queries local database please correct me if i am wrong i will limit using it and will update the post

4 points

I had to go check, I think you are right with the "Si" flag. The S is a database operation and you need to add the y flag to refresh those databases. I learned a bit more about pacman and it's search options today, thanks.

6 points
unknown author

Deleted before we saved it.

1 points

Damn, I never knew you can get preview of the additional information. Guess I get a new alias, thanks

2 points

There's a tool in the community repo called pacui that does the same and have another options to mantain the system in a simple cli ui.

1 points

I actually put my personal tool for this in the AUR recently. I'm currently adding support for paru as well.

AUR GitHub GitLab

1 points

Thank you so much ! Just came back to this post because I reinstalled arch on my laptop, but this oneliner has been so useful to me :D Not having to look up the exact package name whenever I want to install something is a great productivity improvement!

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.