summaryrefslogtreecommitdiffstats
path: root/src/install/pacman.md
blob: 73e7d458bb0c040e1f575324d2bceda608ae2e0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Pacman

Set options in pacman config (`/etc/pacman.conf`)

```conf
# /etc/pacman.conf
[Options]
UseSyslog
Color
CheckSpace
VerbosePkgLists
ParallelDownloads = 5
```

## AUR

Install paru AUR helper

```console
sudo pacman -S --needed base-devel
git clone https://aur.archlinux.org/paru.git ~/src/paru
cd ~/src/paru
makepkg -si
```

Enable rustc flags for makepkg

```conf
# /etc/makepkg.conf
RUSTFLAGS="-C opt-level=2 -C target-cpu=native"
```

## Utils

Install utility scripts

```console
paru -S pacman-contrib
```

## Reflector

Reflector is a utility to optimize the pacman mirrorlist.

Install reflector package

```console
paru -S reflector
```

Set flags for reflector

```confg
# /etc/xdg/reflector/reflector.conf
--save /etc/pacman.d/mirrorlist
--country us
--age 2
--score 10
--sort rate
```

Run reflector to update mirror list

```console
sudo systemctl start reflector.service
```

## Hooks

Install hooks

```console
paru -S check-broken-packages-pacman-hook-git pacman-backup-hook reflector-pacman-hook-git
```

```config
# /etc/pacman.d/hooks/zsh.hook
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Path
Target = usr/bin/*

[Action]
Depends = zsh
Depends = procps-ng
When = PostTransaction
Exec = /usr/bin/pkill zsh --signal=USR1
```