Remove a package with its dependencies

You know that if you install a package that needs many dependencies, zypper will resolve them for you, easy.

For example, Valve’s “steam” that is in the SUSE Non-OSS repository.

It will install 84 new packages. Why? Because it’s a 32 bit program and it needs 32 bit libraries that are not used for anything else. x86 processors have been 64 bit for many years now. As a matter of fact, SUSE does not have a 32 bit distribution anymore. But it does have 32 bit libraries for a lot of stuff, to maintain backwards compatibility.

zypper install steam
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 84 NEW packages are going to be installed:
 Mesa-32bit Mesa-libEGL1-32bit Mesa-libGL1-32bit Mesa-libglapi0-32bit alsa-devel alsa-devel-32bit dbus-1-glib-32bit gdk-pixbuf-query-loaders-32bit glibc-devel
 gtk2-engine-oxygen-32bit gtk2-tools-32bit libLLVM-32bit libSDL-1_2-0-32bit libX11-xcb1-32bit libXcomposite1-32bit libXcursor1-32bit libXdmcp6-32bit libXft2-32bit
 libXi6-32bit libXxf86vm1-32bit libatk-1_0-0-32bit libcairo2-32bit libcanberra-gtk0-32bit libcanberra-gtk2-module-32bit libcanberra0-32bit libcurl4-32bit libdatrie1-32bit
 libdrm2-32bit libdrm_amdgpu1-32bit libdrm_intel1-32bit libdrm_nouveau2-32bit libdrm_radeon1-32bit libedit0-32bit libelf1-32bit libfreebl3-32bit libgbm1-32bit
 libgdk_pixbuf-2_0-0-32bit libgio-2_0-0-32bit libglib-2_0-0-32bit libgmodule-2_0-0-32bit libgobject-2_0-0-32bit libgraphite2-3-32bit libgtk-2_0-0-32bit
 libgudev-1_0-0-32bit libharfbuzz0-32bit libicu57_1-32bit libjasper1-32bit libjbig2-32bit libjpeg8-32bit libltdl7-32bit libncurses6-32bit libnghttp2-14-32bit
 libnm-glib4-32bit libnm-util2-32bit libopenal1-32bit libpango-1_0-0-32bit libpciaccess0-32bit libpixman-1-0-32bit libpsl5-32bit libsoftokn3-32bit libsqlite3-0-32bit
 libssh2-1-32bit libthai0-32bit libtheora0-32bit libtiff5-32bit libudev1-32bit libvorbisfile3-32bit libwayland-client0-32bit libwayland-server0-32bit libxcb-dri2-0-32bit
 libxcb-dri3-0-32bit libxcb-glx0-32bit libxcb-present0-32bit libxcb-render0-32bit libxcb-shm0-32bit libxcb-sync1-32bit libxcb-xfixes0-32bit libxshmfence1-32bit
 linux-glibc-devel mozilla-nspr-32bit mozilla-nss-32bit mozilla-nss-certs-32bit steam zenity

84 new packages to install.
Overall download size: 33.7 MiB. Already cached: 0 B. After the operation, additional 112.8 MiB will be used.
Continue? [y/n/? shows all options] (y):

If you later decide to uninstall steam, use this to remove all those 84 packages:

zypper remove --clean-deps steam

Surprisingly easy.

Alternatively, YaST Software Manager has an Option called “Cleanup when deleting packages”. If you leave it checked, it will do that every time you remove a package with Software Manager.