UserPreferences

PackageManagerCheatsheet


1. Package Manager Cheatsheet

This matrix lists common tasks and the command arguments to perform the task with dpkg, rpm, apt, and yum. Note that apt and yum are really front-end tools for managing packages with dpkg and rpm. The RPM-oriented commands are known to work on Red Hat/Fedora; Mandrake, SUSE, etc are unknown, as some ship slightly older versions. urpmi is not included because I don't have a Mandrake installation to test it on. SysV packages are included because I'm using Solaris again frequently.

Notes on terminology:

Package Task dpkg command rpm command apt command yum command
Show description about <pkg> dpkg -s <pkg> rpm -qi <pkg> apt-cache show <pkg> yum info <pkg>
Install <pkg-file> dpkg -i <pkg> rpm -ivh <pkg> apt-get install <pkg> yum install <pkg>
Remove <pkg> dpkg -r <pkg> rpm -e <pkg> apt-get remove <pkg> yum remove <pkg>
Find package which owns <file> dpkg -S <file> rpm -qf <file> N/A yum provides <file>
List files in installed <pkg> dpkg -L <pkg> rpm -ql <pkg> N/A N/A
List files in <pkg-file> dpkg-deb -c <pkg-file> rpm -qlp <pkg-file> N/A N/A
List all installed packages dpkg -l rpm -qa N/A yum list installed
Verify integrity of installed files from <pkg> N/A rpm -V <pkg> N/A N/A
Verify integrity of install files from all packages N/A rpm -Va N/A N/A
Verify integrity of <pkg-file> N/A rpm -K <pkg-file> N/A N/A
Package Task SysV (Solaris) AIX
Show description about <pkg> pkginfo -l <pkg> lslpp -l <pkg>
Install <pkg-file> pkgadd -d <pkg-file> Varies
Remove <pkg> pkgrm <pkg> installp -u <pkg>
Find package which owns <file> pkgchk -l -p <file> lslpp -w <file>
List files in installed <pkg> pkgchk -l <pkg>|awk '/^Pathname/ {print $2}' lslpp -f <pkg>
List files in <pkg-file> pkgchk -l -d <pkg-file>|awk '/^Pathname/ {print $2}' restore -qTf <pkg-file>
List all installed packages pkginfo lslpp -l
Verify integrity of installed files from <pkg> pkgchk <pkg> lppchk -c <pkg>
Verify integrity of install files from all packages pkginfo|awk '{print $2}'|xargs pkgchk lppchk -c

1.1. Some Useful Shell Aliases or Functions

function pkgls { pkgchk -l "$@" | awk '/^Pathname/ {print $2}'; }

See also: