Memorize Most Useful Pacman Commands
If you’re running Arch Linux, or anything Arch-based like CachyOS, you already know that pacman is one of the core tools you’ll useโprobably daily.
But letโs be real: remembering all those -S, -R, -Q, and -Syu flags gets confusing fast. I used to look them up constantly (even for simple stuff), until I sat down and made a simple system to actually remember them.
๐ง Basic Concept: Think in Categories
Rather than memorizing every command individually, we grouped them by what we needed to do. Just like you’d do in real life:
- Install something
- Remove something
- Search for something
- Get information
- Clean things up
Turns out, pacman follows this logic really well.
โ Install & Update Packages
Install a package:
pacman -S <package>
๐ง Remember -S as โSend it to meโ (Sync from the repository).
Update everything (the Arch way):
pacman -Syu
๐ง Mnemonic: โSync, refresh the repos with y, and update everything.โ
Youโll use this more than anything else.
๐๏ธ Remove Packages (Cleanly!)
Remove a package:
pacman -R <package>
Just deletes the programโnot configs or dependencies.
Full, squeaky-clean removal:
pacman -Rns <package>
๐ง Rns = Remove Neatly & Squeaky โ it deletes the package, its unused dependencies, and leftover config files. I use this when I’m done testing something.
๐ Searching for Packages
Search available packages (online repo):
pacman -Ss <keyword>
๐ง Ss = Search Store
Search only installed packages:
pacman -Qs <keyword>
๐ง Qs = Query System
๐ Package Information
Get info about a package in the repo:
pacman -Si <package>
Get info about an installed package:
pacman -Qi <package>
List all files a package installed:
pacman -Ql <package>
Find out what package owns a file:
pacman -Qo /path/to/file
๐งน Cleanups & Maintenance
Arch doesn’t clean up after itself by default, so we run these occasionally:
Remove orphaned packages (leftovers):
pacman -Rns $(pacman -Qdtq)
Clean the package cache (but keep most recent):
pacman -Sc
Clean EVERYTHING in the cache:
pacman -Scc
๐ง Scc = Super clean cache (but be carefulโyouโll need to re-download packages later).
โ ๏ธ Bonus: Troubleshooting Tools
These arenโt used often, but theyโre lifesavers:
- Check missing files from installed packages:
pacman -Qk - Mark a package as explicitly installed:
pacman -D --asexplicit <package> - Mark it as a dependency instead:
pacman -D --asdeps <package>
๐ง Trick to Memorize Them All
- We grouped all commands by action. Just ask yourself: Am I installing? Searching? Cleaning?
- Made up little mnemonics:
Syu= โSync Your UniverseโRns= โRemove Neatly & SqueakyโSs= โSearch StoreโQi= โQuery Installedโ
- Typed them often. Practice helps way more than reading.
๐ Final Cheat Sheet
Hereโs a quick reference:
| Action | Command | Reminder |
|---|---|---|
| Install | pacman -S <pkg> | Sync |
| Update system | pacman -Syu | Sync Your Updates |
| Remove | pacman -R <pkg> | Remove |
| Remove clean | pacman -Rns <pkg> | Neat & Squeaky |
| Search repo | pacman -Ss <name> | Search Store |
| Search installed | pacman -Qs <name> | Query System |
| Info (repo) | pacman -Si <pkg> | Show Info |
| Info (installed) | pacman -Qi <pkg> | Query Installed |
| Files by pkg | pacman -Ql <pkg> | Query List |
| Who owns file | pacman -Qo /file | Query Owner |
| Remove orphans | pacman -Rns $(pacman -Qdtq) | Clean Deps |
| Clean cache | pacman -Sc | Soft Clean |
| Clean ALL | pacman -Scc | Super Clean |



Post Comment