Recently I 've been wanting to create a custom parameter for pacman.

To elaborate, I have tweaked pacman.conf so that specific packages (linux, linux-firmware, and a couple more) are ignored when I use # pacman -Syu to upgrade all packages - unless they are explicitly mentioned (eg. # pacman -Syu linux linux-firmware).

So what I want now is a parameter to use instead of mentioning each package that is normally ignored.

Summing it up, I want to create a parameter (say --param) so that # pacman -Syu --param be equivalent to # pacman -Syu linux linux-firmware linux-headers ....

  1. Trying to implement this using aliases seems to be impossible (unless I've missed something).
  2. A parameter to allow upgrading all ignored packages would be welcome, albeit not ideal. It also seems to me that it would be far more difficult to construct.
  3. I'm currently using bash (and sometimes zsh) - I'm open to suggestions though.
  • You could use a function. Those allow passing parameters. Or a wrapper script. – Sergiy Kolodyazhnyy Jul 21 '18 at 0:44
  • Or you can create an alias. – Peschke Jul 21 '18 at 4:46

First, this is a terrible idea. IgnorePkg is meant to be a temporary measure as it is essentially forcing partial upgrades, not something that is your de facto approach to package management for a rolling release.

Having said that, it would be relatively straightforward to create a function to achieve your goal.

fullupgrade() { pacman -Syu $(awk -F= '/^IgnorePkg/ {print $NF}' /etc/pacman.conf) ; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.