diff --git a/pacman.md b/pacman.md new file mode 100644 index 000000000..585b16ed6 --- /dev/null +++ b/pacman.md @@ -0,0 +1,54 @@ +--- +title: Pacman +category: Linux +updated: 2018-07-07 +intro: | + Pacman is the package manager for Arch linux and its derivatives. +--- + +## Commands +{: .-three-column} + +### Common commands + +| Command | Description | +| ----------------------- | --------------------------------- | +| `pacman -Syu ` | Install (and update package list) | +| `pacman -S ` | Install only | +| `pacman -Rsc ` | Uninstall | +| `pacman -Ss ` | Search | +| `pacman -Syu` | Upgrade everything | +{: .-prime} + +### Query + +| Command | Description | +| -------------------- | -------------------------------------- | +| `pacman -Qe` | List explictly-installed packages | +| --- | --- | +| `pacman -Ql ` | What files does this package have? | +| `pacman -Qii ` | List information on package | +| --- | --- | +| `pacman -Qo ` | Who owns this file? | +| --- | --- | +| `pacman -Qs ` | Search installed packages for keywords | + +### Orphans + +| Command | Description | +| ----------------------------- | --------------------------- | +| `pacman -Qdt` | List unneeded packages | +| `pacman -Rns $(pacman -Qdtq)` | Uninstall unneeded packages | + +Avoid orphans by using `pacman -Rsc` to remove packages, which will remove unneeded dependencies. + +### Other + +| Command | Description | +| ------------------ | -------------------------- | +| `pactree ` | What does _pkg_ depend on? | +| `pactree -r ` | What depends on _pkg_? | + +### References + +* [Pacman tips and tricks](https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks) _(wiki.archlinux.org)_