blob: 781a0b9257b54ea6e16471641963e8dacac236e9 (
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
|
#!/bin/sh
# keeping a fresh list of all explicitly installed packages
pacman -Qqe > "/home/jay/stuf/ARESEES/pkglist.txt"
pacman -Qqen > "/home/jay/stuf/ARESEES/pkglist_native.txt"
pacman -Qqem > "/home/jay/stuf/ARESEES/pkglist_foreign.txt"
# pacman -S --needed - < pkglist.txt to install them
# pacman -S --needed $(comm -12 <(pacman -Slq | sort) <(sort pkglist.txt)) to filter out the AUR ones
# pacman -Rsu $(comm -23 <(pacman -Qq | sort) <(sort pkglist.txt)) final check to make sure only listed packages are present on the system
# -----------------------------------------------------------------------------------------------------------------------------
# removing all but 3 most recent package versions
paccache -r
paccache -ruk0 # every version if said package is uninstalled
# you can enable/start paccache.timer for the first one to happen automatically
# -----------------------------------------------------------------------------------------------------------------------------
# removing orphaned packages
pacman -Qtdq | pacman -Rns -
# will throw an error if list is empty, this is fine
# pacman -Qqd | pacman -Rsu --print - does the same as above(?) but also hits circular and excessive dependencies
# -----------------------------------------------------------------------------------------------------------------------------
# figure something out for dotfiles (google: rmshit.py)
|