pacman

Table of Contents

1. List

pacman -Qetn # explicitly installed native packages
pacman -Qm   # packages installed from aur(foreign packages)
ancient-packages # installed packages no longer available (anywhere)
pacman -Ql <package_name> # list all files owned by a given package
pacman -Qtd # list orphan packages
lostfiles # orphaned files not owned by any arch packages:
paccheck --md5sum --quiet  # listing all changed files from packages # TODO: add info

2. Search

pacman -Ss <term1> <term2> # fuzzy search db
pacman -Qs <term1> <term2> # fuzzy search installed packages

3. Info

pacman -Qi [package_name] # details on an installed package
pactree [package_name] # dependency tree: dependencies
pactree -r [package_name] # dependency tree: dependants
pacgraph -c # see how much size the packages are consuming

4. Remove/Clean

pacman -Rs [package_name] # remove a package and its dependencies(safe)
pacman -Rs $(pacman -Qqtd) # clean orphaned packages
paccache -dv # list
paccache -rv # clean

5. Updating mirrors

Prefer france and germany over indian servers

reflector --country France,Germany --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist

6. Useful info

  • No partial upgrades
    • never run pacman -Sy
    • always use pacman -Syu
    • Always upgrade (with pacman -Syu) before installing a package if possible
    • if there's any error when running -Syu, it should be resolved asap

Created: 2024-07-16 Tue 16:44

Validate