Basically, what I’m looking for is the reverse of “IgnorePkg”: Some way to prevent certain packages from being upgraded except during “pacman -Syu”.
The reason for this is that I have managed to break something important several times merely by doing partial upgrades. I try to install some package, its dependencies include a newer version of a package I have installed, I upgrade that dependency, and on the next boot my display manager fails to start. Stuff like that. It’s annoying.
I can’t memorize every package required by every important OS package, and apparently pacman’s version checks are incomplete, so I see no other way to prevent this from happening than protecting all dependencies of certain packages (Xorg, display manager, gpu drivers etc.) from being individually upgraded under any circumstances. Pacman should throw an error if I try to do so outside of the context of a full system upgrade instead of letting me set myself up for booting issues. But how do I achieve this?
I’m not asking for a way to install packages without their dependencies. I want pacman to tell me that I can’t install a package if its dependencies require upgrading a package on which a high importance package like Xorg or sddm depends.
Dependencies such as libraries that are shared between the package I’m trying to install and sddm.
Which can break sddm even when pacman doesn’t detect a conflict.
I don’t think pacman can do such thing. You, on the other hand, could create a script that checks the dependencies of a package and looks for packages that you don’t want to be updated. Then throw an error yourself.
That’s a decent idea, I probably would have done this already but I’m not really sure how to make a script intercept a pacman call/interact with it in the way described. I know how to run a script before or after installing a package, but not how to have pacman provide it with a list of packages and then wait for a response. Well I guess I could write a wrapper. Just need to remember to actually use it instead of pacman -S.
echo TEST END
The script works as intended, but the hook fails with:
:: Running pre-transaction hooks...
call to execv failed (No such file or directory)
error: command failed to execute correctly
error: failed to commit transaction (failed to run transaction hooks)
Errors occurred, no packages were upgraded.
Plus perhaps I wanted a way to circumvent it? Like maybe when I want to refresh now and upgrade later or something. I’m only interested in preempting my own thoughtless mistakes, not the thoughtful ones.