http://anadoxin.org/blog

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:

$ pacman -Qo /usr/bin/ls
/usr/bin/ls is owned by coreutils 9.1-3

dpkg:

$ dpkg -S lspci
pciutils: /usr/bin/lspci

rpm:

$ rpm -qf /usr/bin/ps
procps-ng-3.3.17-4.fc36.1.x86_64

Q: Listing the contents of selected package

Pacman:

$ pacman -Ql coreutils

dpkg:

$ dpkg -L coreutils

rpm:

$ rpm -ql procps-ng

Q: Dump information about a package

Pacman:

$ pacman -Qi coreutils

dpkg:

$ dpkg -s coreutils

rpm:

$ 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.