Standard actions of Linux package managers
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 Ubuntu, ArchLinux and Fedora, so I'll include deb, pacman and rpm flavors.
Q: Locating the owner package of a specified file
$ pacman -Qo /usr/bin/ls /usr/bin/ls is owned by coreutils 9.1-3
$ dpkg -S lspci pciutils: /usr/bin/lspci
$ rpm -qf /usr/bin/ps procps-ng-3.3.17-4.fc36.1.x86_64
Q: Listing the contents of selected package
$ pacman -Ql coreutils
$ dpkg -L coreutils
$ rpm -ql procps-ng
Q: Dump information about a package
$ pacman -Qi coreutils
$ dpkg -s coreutils
$ rpm -qi coreutils
I'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.