diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2021-11-24 22:33:18 +0100 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2021-11-24 22:33:18 +0100 |
commit | 4b2d24e60b147e5a7552e01ba800573164b2c441 (patch) | |
tree | cdd471ec7e142a86eebf14431474232d76343257 /src/tools | |
parent | e9a30288fde1f46422f41a9fc5c84564df007c4c (diff) | |
download | notes-4b2d24e60b147e5a7552e01ba800573164b2c441.tar.gz notes-4b2d24e60b147e5a7552e01ba800573164b2c441.zip |
pacman: added pacman notes
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/pacman.md | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/tools/pacman.md b/src/tools/pacman.md new file mode 100644 index 0000000..f6b560b --- /dev/null +++ b/src/tools/pacman.md @@ -0,0 +1,58 @@ +# pacman(1) + +## Remote package repositories + +```text +pacman -Sy refresh package database +pacman -S <pkg> install pkg +pacman -Ss <regex> search remote package database +pacman -Si <pkg> get info for pkg +pacman -Su upgrade installed packages +pacman -Sc clean local package cache +``` + +## Remove packages + +```text +pacman -Rsn <pkg> uninstall package and unneeded deps + config files +``` + +## Local package database + +Local package database of installed packages. + +```text +pacman -Q list all installed packages +pacman -Qs <regex> search local package database +pacman -Ql <pkg> list files installed by pkg +pacman -Qo <file> query package that owns file +pacman -Qe only list explicitly installed packages +``` + +## Local file database + +Local file database which allows to search packages owning certain files. +Also searches non installed packages, but database must be synced. + +```text +pacman -Fy refresh file database +pacman -Fl <pkg> list files in pkg (must not be installed) +pacman -Fx <regex> search +``` + +## Hacks + +Uninstall all orphaned packages (including config files) that were installed as +dependencies. +```text +pacman -Rsn $(pacman -Qqtq) +``` + +List explicitly installed packages that are not required as dependency by any +package and sort by size. +```text +pacman -Qetq | xargs pacman -Qi | + awk '/Name/ { name=$3 } + /Installed Size/ { printf "%8.2f%s %s\n", $4, $5, name }' | + sort -h +``` |