Pacman configuration: Difference between revisions
From wikinotes
No edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
|- | |- | ||
| <code>man makepkg.conf</code> || https://man.archlinux.org/man/makepkg.conf.5.en | | <code>man makepkg.conf</code> || https://man.archlinux.org/man/makepkg.conf.5.en | ||
|- | |||
| <code>man alpm-hooks</code> || https://man.archlinux.org/man/core/pacman/alpm-hooks.5.en | |||
|- | |- | ||
|} | |} | ||
</blockquote><!-- Documentation --> | </blockquote><!-- Documentation --> | ||
= Tutorials = | |||
<blockquote> | |||
{| class="wikitable" | |||
|- | |||
| alpm-hook examples || https://github.com/andrewgregory/pachooks/tree/master/hooks | |||
|- | |||
|} | |||
</blockquote><!-- Tutorials --> | |||
= Locations = | = Locations = | ||
Line 14: | Line 25: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| <code>/etc/pacman.conf</code> | | <code>/etc/pacman.conf</code> || pacman config | ||
|- | |- | ||
| <code>/etc/pacman.d/mirrorlist</code> | | <code>/etc/pacman.d/mirrorlist</code> || package sources | ||
|- | |- | ||
| <code>/etc/makepkg.conf</code><br><code>~/.makepkg.conf</code><br><code>$XDG_CONFIG_HOME/makepkg.conf</code> || configure default build options | | <code>/etc/makepkg.conf</code><br><code>~/.makepkg.conf</code><br><code>$XDG_CONFIG_HOME/makepkg.conf</code> || configure default build options | ||
|- | |||
| <code>/etc/pacman.d/hooks/*.hook</code> || alpm-hooks (trigger on package/file changes during update) | |||
|- | |- | ||
|} | |} | ||
Line 55: | Line 68: | ||
Customize global package build options. | Customize global package build options. | ||
</blockquote><!-- makepkg.conf --> | </blockquote><!-- makepkg.conf --> | ||
= update hooks = | |||
<blockquote> | |||
You can use <code>alpm-hooks</code> to run scripts when matching packages or files are changed. | |||
<syntaxhighlight lang="ini"> | |||
# /etc/pacman.d/hooks/reset-kbd-settings.hook | |||
# whenever a package matching 'linux*' is changed | |||
# the executable /usr/bin/kbd is executed | |||
[Trigger] | |||
Type = Package | |||
Operation = Install | |||
Operation = Upgrade | |||
Operation = Remove | |||
Target = linux* | |||
[Action] | |||
When PostTransaction | |||
Exec = test -e /usr/bin/kbd && /usr/bin/kbd | |||
AbortOnFail | |||
</syntaxhighlight> | |||
</blockquote><!-- package/file hooks --> |
Latest revision as of 23:51, 25 August 2023
Documentation
man pacman.conf
https://man.archlinux.org/man/core/pacman/pacman.conf.5.en man makepkg.conf
https://man.archlinux.org/man/makepkg.conf.5.en man alpm-hooks
https://man.archlinux.org/man/core/pacman/alpm-hooks.5.en
Tutorials
alpm-hook examples https://github.com/andrewgregory/pachooks/tree/master/hooks
Locations
/etc/pacman.conf
pacman config /etc/pacman.d/mirrorlist
package sources /etc/makepkg.conf
~/.makepkg.conf
$XDG_CONFIG_HOME/makepkg.conf
configure default build options /etc/pacman.d/hooks/*.hook
alpm-hooks (trigger on package/file changes during update)
mirrorlist
You can automatically determine the fastest servers and sort them by quickest.
I wrote a bashscriptpacman-mirrorlist
to do this for me.sudo pacman -S pacman-contrib # generate mirrorlist for all CA/US mirrors awk '/^## Canada$/{f=1; next}f==0{next}/^$/{exit}{print substr($0, 1);}' /etc/pacman.d/mirrorlist.pacnew | sed 's/^#//' | sudo tee /etc/pacman.d/mirrorlist.tmp awk '/^## United States$/{f=1; next}f==0{next}/^$/{exit}{print substr($0, 1);}' /etc/pacman.d/mirrorlist.pacnew | sed 's/^#//' | sudo tee -a /etc/pacman.d/mirrorlist.tmp rankmirrors -n 10 /etc/pacman.d/mirrorlist.tmp | sudo tee /etc/pacman.d/mirrorlist
pacman.conf
Holding/Pinning/Locking Packages
Packages can be set to be ignored in
/etc/pacman.conf
.IgnorePkg = salt zfs-linux spl-linux
makepkg.conf
Customize global package build options.
update hooks
You can use
alpm-hooks
to run scripts when matching packages or files are changed.# /etc/pacman.d/hooks/reset-kbd-settings.hook # whenever a package matching 'linux*' is changed # the executable /usr/bin/kbd is executed [Trigger] Type = Package Operation = Install Operation = Upgrade Operation = Remove Target = linux* [Action] When PostTransaction Exec = test -e /usr/bin/kbd && /usr/bin/kbd AbortOnFail