↑↑ Home ↑ Root  

Linux package manager cheat sheet

When you have several Linux boxes or help several people administer theirs, you often have to deal with different distributions and their package managers, too. This table is a cheat sheet to answer the frequent question "how do you do that under that distribution again?".

Action Redhat, SuSE, Mandriva Ubuntu Arch Gentoo
Install package rpm -i <package file> aptitude install <package> pacman -S <package> emerge <package>
Uninstall package rpm -e <package> aptitude remove <package> pacman -R <package> emerge --depclean <package>
Show package description rpm -qi <package> aptitude show <package> pacman -S -i <package> (emerge -s <package>)
Search for a package ? aptitude search <string> pacman -S -s <string> emerge -s <string>
List installed packages rpm -qa dpkg -l -a pacman -Q -s '.*' equery list \*
Find package containing file rpm -qf <file> dpkg -S <file> pacman -Q -o <file> equery belongs <file>
List files in package rpm -ql <package> dpkg -L <package> pacman -Q -l <package> equery files <package>

For a more extensive one-to-one comparison of package manager options, see the "Pacman Rosetta" at the arch linux distribution wiki.