this post was submitted on 25 Nov 2023
17 points (87.0% liked)

Arch Linux

7777 readers
2 users here now

The beloved lightweight distro

founded 4 years ago
MODERATORS
 

I recently got into Arch Linux via EndeavourOS. I'm trying to find a way to remember all the Pacman and Yay commands, but I'm not able to find a good approach to remembering most of the commands.

Does anybody have any mnemonics to help with this? For example, how did you remember that Yay -Yc was the command to remove all unneeded dependencies?

top 9 comments
sorted by: hot top controversial new old
[–] backhdlp@lemmy.blahaj.zone 5 points 1 year ago

I read the man page and used --help more than I could remember, now the stuff I use stuck with me. Base pacman commands are actually named and shortened pretty intuitively. I only use AUR helpers for exactly that, so I pretty much don't use all the extra functionality.

[–] somenonewho@feddit.de 5 points 1 year ago

Gotta agree with Ozymandias aliases are the way to go.

I've set up a few different aliases "search" which is just pacman -Ss "install" (pacman -Sy) "update" (pacman -Syyu) "remove" (pacman -Rns) and finally as to your question about unneeded dependencies I've got "clean" which first does an orphan check/clean (pacman -Qtdq | pacman -Rns -) and afterwards also cleans the package cache (pacman -Sc) Also the aliases are automatically prefixed with sudo (if it is installed).

This way I simply run update and afterwards clean and my system is up to date and cleaned of orphans.

I've created these aliases back when I was still using 3Distros (Arch,Debian/*buntu, Fedora) so my alias definition comes after a little script that determines the correct package manager and, depending on that, sets the aliases. But that's of course only necessary if you use different distros and want your aliases to be portable.

Tl;dr: Set up aliases for things you wanna do often. Check the wiki for reference if you only want to do something every so often.

[–] z00s@lemmy.world 3 points 1 year ago (1 children)

THAT IS SO COOL 🤩 makes a mental note to remember cheat.sh, stores mental note in Mental Sieve #3

[–] ozymandias@feddit.nl 2 points 1 year ago

I don't use yay so can't help you there. For me the most useful pacman commands just got memorized after doing an install. I don't think you need to memorize that much.

But to your question, instead of mnemonics you could use aliases instead for bash or zsh. that way you can use your own made up commands (or even mnemonics)

[–] RiikkaTheIcePrincess@pawb.social 2 points 1 year ago* (last edited 1 year ago) (2 children)

I'd just like to point out the objective fact that Yay is the best-named AUR helper ^.^ :3

As for the actual question, I'm not sure how many I should be using? I kinda just remember -Syu and -Ss and -Ql because I use them muchly; for most else pacman --help -Q/S/whatever helps lots. For the last little bit, there's rage-searxing and doing what some mean person on the Arch forums says to do :D

Edit: I think a mean person from the Arch forums downvoted me :D

[–] Astaroth@lemm.ee 1 points 1 year ago

-Syu

you can just type yay and it defaults to -Syu if there's no other argument

 

also while I never use pacman on its own (I always use yay) I still check the pacman man page every now and then because while all the commands from pacman can still be used the yay manual only shows the commands added besides pacman's default commands

[–] soupcat@sopuli.xyz 1 points 1 year ago

I just did yay bauh and now it's fine

[–] Cosmocrat@lemmy.dbzer0.com 2 points 1 year ago

If you install paru then all you need to do is type paru to start a full system upgrade, its an alias for paru -Syu.