zypper vs. apt and rpm vs. dpkg command comparison

Written by - 2 comments

Published on June 12th 2013 - last updated on May 31st 2019 - Listed in Linux Shell


The following table shows a comparison of the most important and most used commands for package/software management in SuSE and Debian/Ubuntu systems.

zypper vs. apt command comparison

The zypper command is available on SuSE systems.

The apt and related commands are available on Debian and Debian-based systems including Ubuntu, Linux Mint, Knoppix, and a lot more.

Function
zypper command
 apt command
Search package zypper se "pkgname" apt-cache search "pkgname"
Install package zypper in "pkgname"
apt-get install "pkgname"
apt install "pkgname" (newer)
Update package list from repository zypper refresh
apt-get update
apt update (newer)
Update all packages zypper update

apt-get upgrade
apt upgrade (newer)

Upgrade all packages to new major version* zypper dist-upgrade
apt-get dist-upgrade
apt dist-upgrade (newer)
Update a single package zypper update "pkgname"
apt-get upgrade "pkgname"
apt upgrade "pkgname"
or "install" should also update the package
Uninstall/remove a package zypper remove "pkgname"
apt-get remove "pkgname"
apt remove "pkgname"
Show all packages found in repo(s) zypper packages
apt-cache pkgnames
Show updateable packages zypper list-updates
apt-show-versions -u
Show dependencies of a package N/A
apt-cache depends "pkgname"
Show description of a package zypper info "pkgname"
apt-cache show "pkgname"

rpm vs. dpkg command comparison

Function
 rpm command
dpkg command
List installed packages rpm -qa dpkg -l
List content of installed package rpm -ql "pkgname"
dpkg -L "pkgname"
List content of package file rpm -qlp "pkgname".rpm
dpkg --contents "pkgname".deb
Install package rpm -i "pkgname".rpm
dpkg -i "pkgname".deb
Show to which package a file belongs
rpm -qf /path/to/file
dpkg -S /path/to/file
Simulate installation of package rpm -i --test "pkgname".rpm
dpkg -i --simulate "pkgname"
Update a package rpm -U "pkgname".rpm
N/A (use dpkg -i)
Uninstall/remove a package rpm -e "pkgname"
dpkg -r "pkgname"

If you know additional zypper/apt/rpm/dpkg commands which are worth to be compared and mentioned here, please drop a comment.

Update June 14th, 2013: Added apt-get dist-upgrade to the table. This command allows to upgrade to a newer major software version (e.g. MySQL 5.0 -> 5.1). However it should be mentioned, that although this command exists in Debian, it is unlikely that it's going be used (except for a distribution upgrade, e.g. lenny -> squeeze). The reason for this is the "stable software version" mind of Debian. Ubuntu handles this approach differently and frequently adds newer major versions to their repositories.

Update July 10th, 2015: Added "list content" rpm and dpkg commands.

Update September 16th, 2015: Added "Simulate installation of package" rpm and dpkg commands.

Update March 13th, 2019: Added "apt" short commands.

Update May 31st, 2019: Added "Show to which package a file belongs".


Add a comment

Show form to leave a comment

Comments (newest first)

anon from wrote on Jan 11th, 2014:

The zypper equivalent for a distribution upgrade (apt-get dist-upgrade) is "zypper dup". See https://en.opensuse.org/SDB:System_upgrade

The Arch wiki has a similar comparison of more tools:
https://wiki.archlinux.org/index.php/Pacman_rosetta


Alexander from Z├╝rich wrote on Jun 12th, 2013:

Might be worth mentioning, that for Debian the "Update all packages" would rather be:

apt-get dist-upgrade

Because of the "all packages" there. Don't know how that compares to zypper.