Arch Linux pacman

Arch Linux pacman [ home ]


(See the docs
for more details, of which the below text is a selective summary.)

Table of Contents

Query/info

  • pacman -Qs $my_regex : search for RE in local database
  • pacman -Ss $my_regex: search for RE in list of available packages
  • pacman -Si $my_pgk_name: display info about package
  • pacman -Ql $my_pkg_name: display list of files installed by a package
    (use pkgfile -l <pkgname> to display contents for not-installed packages)
  • pacman -Qo $my_file_path: find out to which a package a local file belongs
  • pacman -Qdt: list orphaned packages
  • pacman -Qet: list explicitly installed packages (in contrast to pulled-in deps)
  • pactree -a $my_pkg_name: list dep-tree of a package (-a is for ASCII-tree-chars)
  • whoneeds $my_pkg_name or pactree -ar $my_pkg_name: find out who depends on a package
    the system – partial upgrade is not supported.

Adding/removing

  • pacman -S $my_pkg_name: install package(s)
  • pacman -R $my_pkg_name: remove package only – leave deps installed
  • pacman -Rs $my_pkg_name: remove package and all its would-be orphaned deps

Maintenance

  • pacman -Sc: clean up cache from downloaded and old packages
  • pacman -Sy: DO NOT use this; it refreshes the package list without upgrading
  • pacman -Syu: sync repo-db and update all packages
  • checkupdates: check for updates (but do not update, as per pacman -Syu)
  • makepkg -si: create/install package from descr (incl. PKGBUILD) in a local dir

Read more here: Source link