Standard actions of Linux package managers
https://anadoxin.org/blog/linux-package-managers.html/
Sat, 25 February 2023 :: #linux
I keep forgetting the command line options for standard Linux package manager actions, so I've decided to write a blog post about it. I'm currently using Gentoo, ArchLinux and Fedora, so I'll include pacman, rpm and deb flavors (for completion).
Q: Locating the owner package of a specified file
Portage:
$ qfile /usr/bin/ls # or 'equery b /usr/bin/ls'
sys-apps/coreutils: /usr/bin/lsPacman:
$ pacman -Qo /usr/bin/ls
/usr/bin/ls is owned by coreutils 9.1-3dpkg:
$ dpkg -S lspci
pciutils: /usr/bin/lspcirpm:
$ rpm -qf /usr/bin/ps
procps-ng-3.3.17-4.fc36.1.x86_64Q: Listing the contents of selected package
Portage:
qlist coreutils # or 'equery f coreutils'Pacman:
$ pacman -Ql coreutilsdpkg:
$ dpkg -L coreutilsrpm:
$ rpm -ql procps-ngQ: Dump information about a package
Portage:
$ emerge --search coreutils
or
$ vim `equery w coreutils`Pacman:
$ pacman -Qi coreutilsdpkg:
$ dpkg -s coreutilsrpm:
$ rpm -qi coreutilsI'm not delusional enough to expect that I'll remember this, but at least now I'll have a one-stop place where I can quickly look this up.
