m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/pacman.md
blob: 3a5434dd5473ae7e7a2a66320f64837ba8c0e002 (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
# Arch Linux Packages

## Downgrade cached package

    pacman -U /var/cache/pacman/pkg/package-version...

## Cleaning cache

    paccache -r

* `-k`: how many past versions of each package to keep, defaults to 3.
* `-u`: target only uninstalled packages.

    # remove all versions of uninstalled packages
    paccache -ruk0

## Troubleshooting failed installations

Usually enough to update keyring:

    pacman -Sy archlinux-keyring

Might need to update mirrorlist first if outdated:

    sudo pacman -Sy pacman-mirrorlist

(this might put it in /etc/pacman.d/mirrorlist.pacnew, uncomment wanted mirrors
there and remove the .pacnew suffix)

## Query (-Q)

By itself, outputs all installed packages.

List packages by size:

    pacman -Qi | egrep '^(Name|Installed)' \
        | cut -f2 -d':' | tr '\n' ' ' \
        | sed 's/B/B\n/g' | sed -e 's/^\s\+//' \
        | sed -e 's/ M/M/' -e 's/ K/K/' -e 's/ B/B/' \
        | sort -hk 2