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.
About this post
- Posted
- Archived
- Edited
- Score
- 279 · 97% up
- Kind
- Text
- ID
- ndduvm
30 comments
This is my version, based on a similar Manjaro script:
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.
To also allow reinstalling packages:
for others that may want to add this to their profile files
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.
that awk part is handy thanks for sharing
If you don't mind my asking, what's the point? I'm don't understand what's the use case here.
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.
Ah yes, that is very useful!
I just now used the first one to explore optional dependencies.
What's wrong with -Ss ?
Deleted before we saved it.
I really like these, listing the package contents is a nice touch.
Not quite for me, but just finding out about -Slq and -Qq greatly simplified my bash_completion file, so thank you for that. lol
I combined a bunch of variations from this thread:
with this you can either
parufindon all packages, orparufind zshto open it with the query set tozshright away.Just a noob question. How to create alias?
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)
IIRC,
sudois quirky. You may need to also create a separate alias for sudo itself for that to work:A better example is the common
llalias:Do it!
eg : if you want to alias
sudo pacman -Syutoupdateadd
alias update="sudo pacman -Syu"to your shell's rc fileDeleted before we saved it.
alias pacfind="pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S"
So this hits aur for every single keystroke. I suppose if you use it sparingly it's not that bad.
afik -Si queries local database please correct me if i am wrong i will limit using it and will update the post
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.
Deleted before we saved it.
Damn, I never knew you can get preview of the additional information. Guess I get a new alias, thanks
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.
Wow, fzf's preview feature is nice! TIL!
I actually put my personal tool for this in the AUR recently. I'm currently adding support for paru as well.
AUR GitHub GitLab
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!