[linux@yak.onl ~]$ package manager cheatsheet

This is a cheatsheet for a few package manager reference. NEW PAGE UNDER CONSTRUCTION. Last updates 4.2019. If you wish to lend your own tips or command snippets, you can get in touch via:



Pacman (or Yay)

Common Commands

  • pacman -Ss >pkg< - Search
  • pacman -S >pkg< - Install only
  • pacman -Syy - Update pacman database cache
  • pacman -Syyu - Update grade everything
  • pacman -Syu >pkg< - Install (and update package list)
  • pacman -Syu --ignore >pkg< - Synch pkg db, install updates but ignore a pkg
  • pacman -Syu --ignore=pkg - Update all but ignore a pkg
  • vim /etc/pacman.conf - (you can comment in/uncomment line) # IgnorePkg = pkgname
  • pacman -R >pkg< - Uninstall
  • pacman -Rsc >pkg< - Uninstall + unneeded dependencies
  • pacman -Rdd >pkg< - Force Uninstall
Advisory on Arch: it's necessary to update regularly, if not weekly preferably, due to cutting edge package versions and changing dependency/package versions. This will save unnecessary issues or time concerning maintenance tasks and keep your install working smooth-as-butter. Arch is a rolling distribution, offering the best and latest in software with a small but worthwhile price of simple, regular maintenance updates being mandatory --- the design of this distribution and its package management.

Query

  • pacman -Qe - List explictly-installed packages
  • pacman -Ql >pkg< - List files belonging to package
  • pacman -Qii >pkg< - List info on package
  • pacman -Qo >file< - List owner of file
  • pacman -Qs >query< - Search installed packages for keywords
  • pacman -Syup - Synch pkg db, only print to screen updates

Orphans

  • pacman -Qdt - List unneeded packages
  • pacman -Rns $(pacman -Qdtq) - Uninstall unneeded packages

Dependency info

  • pactree >pkg< - List what package depends on
  • pactree -r >pkg< - List what depends on package [dependencies]

Downgrading

In rare circumstances you may even decide to downgrade or roll-back a previous version. The pacman cache (unless cleared) will store previous versions. You can restore and install any such package in cache after uninstalling the current package.
  • pacman -U /var/cache/pacman/pkg/package_name - upgrade/install pkg version in cache
  • TAB - TAB key can be used to autofill and cycle through matching pkgs in cache
  • pacman -U /var/cache/pacman/pkg/firef + TAB - repeated press of TAB will cycle through matching pkg filename of "firef..."
  • pacman -U any-local-path/package - You can visit Arch linux site to download older versions from below urls:
  • Arch Linux website
  • Arch Linux archive

Tips

If you are an Arch user and enthusiatic who appreciates these tips or find them helpful, please consider supporting this site, and feel welcome to communicate with your own.
Updating cycle/conflicts
In the event you lapse too long between updates (usually months) you may experience package conflict on future updates. The troubleshooting solution is too note offending package and dependencies and uninstall-reinstall. If necessary, you may have to force uninstall, but be careful, note and reinstall immediately and test.

Yay AUR helper

  • Download or clone from the git repo
  • git clone https://aur.archlinux.org/yay.git - clone into a directory from git
  • cd yay - navigate into directoy
  • makepkg -si - make the file

CentOs (or Yum)

TBA