pull down to refresh

Pacman has some pretty weird flag choices, but they make more sense once you get the logic behind them:

-S (sync): Grabs and installs a package from the database
-s (search): Just a modifier telling pacman "don't install anything, just search"
-y (refresh): Updates your package database so it knows what's new out there
-u (update): Upgrades your installed stuff to the newest versions
-Q (query): Shows what packages you've got installed
-R (remove): Kicks a package off your system

So when you run pacman -S firefox, you might not get the newest Firefox version if your local database is outdated. For the latest, you'd need pacman -Sy firefox, which refreshes your database first, then installs Firefox.

pacman -R firefox just removes Firefox from your system
pacman -Ss firefox searches for any packages with "firefox" in the name
pacman -Qs firefox searches for any installed package with "firefox" in the name

the only flag that that never made sense to me is -y, I have no idea why refresh is y

I don't get the case difference logically. I really lean on mnemonics as well for learning. I just haven't figured that out for pacman. This is how I learned Vim and its something I think about when trying to remember anything new.

-S Sync makes no sense to me for install.
-s Search makes sense but I'm not sure why its lowercase
-y makes no sense for refreshing.

I swear its like the creator is trolling us all.

-u makes sense but why lower case
-Q Query makes sense but why upper case and query being local doesn't. Why not lowercase for local and upper for searching?

I would argue that the massive number of CLIs out there that do not follow these patterns is a signal.

I will add... I'm a long time CLI guy and Vim user.

Thanks for the info though.

reply

-U uppercase allows you to install a package from a local file, while still downloading dependencies from the db, so if you do for example pacman -U ~/firefox.tar.gz will download all the dependencies for firefox specified in the tar.gz, but then install the version in your .tar.gz not the one in the sync db.

And if I remember correctly, there's also another -u, that only works with -R, which removes packages only if they're not needed as a dependency of something else.

reply

Yeah, that sounds right. You're making my point btw :)

Maybe this is a common criticism but I don't recall ever hearing it. Honestly, it kinda seems intentionally obtuse and I get that really. The types of questions you see on forums for Mint are... very different from other distros like Arch.

reply

No trust me, I know. It's extremely unintuitive, wasn't trying to argue otherwise, just wanted to be helpful :)

reply

Yeah, I feel ya.

reply

Sorry... its like nails on a chalkboard.

Q queries your local system but s searches remote repos for packages... while S syncs remote to local...

I'm trying to find the patterns and I do not see them.

reply