Package Management Cheatsheet

The following table lists package management tasks in the four most popular distribution groups – Debian (including Ubuntu, Linux Mint, KNOPPIX, sidux and other Debian derivatives), openSUSE, Fedora (including Red Hat Enterprise Linux, CentOS, Scientific Linux and other Fedora-based distributions), and Mandriva Linux.

Taskapt (deb) Debian, Ubuntuzypp (rpm) openSUSEyum (rpm) Fedora, CentOSurpmi (rpm) Mandriva
Managing software
Install new software from package repositoryapt-get install pkgzypper install pkgyum install pkgurpmi pkg
Install new software from package filedpkg -i pkgzypper install pkgyum localinstall pkgurpmi pkg
Update existing softwareapt-get install pkgzypper update -t package pkgyum update pkgurpmi pkg
Remove unwanted softwareapt-get remove pkgzypper remove pkgyum erase pkgurpme pkg
Updating the system
Update package listapt-get update
aptitude updatezypper refreshyum check-updateurpmi.update -a
Update systemapt-get upgrade
aptitude safe-upgradezypper updateyum updateurpmi –auto-select
Searching for packages
Search by package nameapt-cache search pkgzypper search pkgyum list pkgurpmq pkg
Search by patternapt-cache search patternzypper search -t pattern patternyum search patternurpmq –fuzzy pkg
Search by file nameapt-file search pathzypper wp fileyum provides fileurpmf file
List installed packagesdpkg -lzypper search -isrpm -qarpm -qa
Configuring access to software repositories
List repositoriescat /etc/apt/sources.listzypper reposyum repolisturpmq –list-media
Add repository(edit /etc/apt/sources.list)zypper addrepo path name(add repo to /etc/yum.repos.d/)urpmi.addmedia name path
Remove repository(edit /etc/apt/sources.list)zypper removerepo name(remove repo from /etc/yum.repos.d/)urpmi.removemedia media