Linux – How to remove a package in openSUSE without installing anything

linuxopensusepackage-managementrpm

I have an openSUSE server with lots of unnecessary packages installed, which I'd like to remove. However, I find that when I try to do that zypper often wants to install other packages in their place? Why on Earth do I need to install stuff to remove stuff? How do I just remove it?

For example, I want to uninstall all x11 packages so I run:

zypper rm xorg-x11*

I get this:

...
Resolving package dependencies...

The following packages are going to be upgraded:
  python-qt python-qt4 splashy suspend t1lib 


The following packages are going to be downgraded:
  libx86 qt3 


The following NEW packages are going to be installed:
  dbus-1-32bit file-32bit fontconfig-32bit freetype2-32bit libdrm-32bit 
libexpat1-32bit libgcc43-32bit libgcrypt11-32bit libglib-2_0-0-32bit 
libgpg-error0-32bit libgthread-2_0-0-32bit libjpeg-32bit liblcms1-32bit 
liblzo2-2-32bit libmng-32bit libpng12-0-32bit libqt4-32bit libqt4-sql-32bit 
libstdc++43-32bit libtiff3-32bit libuuid1-32bit pciutils-32bit pcre-32bit 
sysfsutils-32bit xorg-x11-libICE-32bit xorg-x11-libSM-32bit xorg-x11-libX11-32bit 
xorg-x11-libXau-32bit xorg-x11-libXext-32bit xorg-x11-libXfixes-32bit 
xorg-x11-libXmu-32bit xorg-x11-libXp-32bit xorg-x11-libXpm-32bit 
xorg-x11-libXprintUtil-32bit xorg-x11-libXrender-32bit xorg-x11-libXt-32bit 
xorg-x11-libXv-32bit xorg-x11-libfontenc-32bit xorg-x11-libs-32bit 
xorg-x11-libxcb-32bit xorg-x11-libxkbfile-32bit zlib-32bit 


The following packages are going to be reinstalled:
  DirectFB Mesa libQtWebKit4 libqt4-qt3support libqt4-x11 php5-gd 


The following packages are going to be REMOVED:
  xorg-x11-libICE xorg-x11-libSM xorg-x11-libX11 xorg-x11-libXau xorg-x11-libXext 
xorg-x11-libXfixes xorg-x11-libXmu xorg-x11-libXp xorg-x11-libXpm 
xorg-x11-libXprintUtil xorg-x11-libXrender xorg-x11-libXt xorg-x11-libXv 
xorg-x11-libfontenc xorg-x11-libs xorg-x11-libxcb xorg-x11-libxkbfile 


The following packages are going to change architecture:
  DirectFB Mesa libQtWebKit4 libqt4-qt3support libqt4-x11 libx86 php5-gd python-qt 
python-qt4 qt3 splashy suspend t1lib 


Overall download size: 34.9 M. After the operation, additional 1.9 M will be used.
Continue? [Y/n/p/?]: n

Best Answer

I don't have an OpenSUSE machine here to test on, but looks to be a dependency issue. You're attempting to remove something which something else depends on, so zipper is trying to satisfy those dependencies by installing other packages which it can use, in this case 32 bit equivalents.

On that basis I'd guess that the dependencies belong to some of these packages:

The following packages are going to change architecture:
  DirectFB Mesa libQtWebKit4 libqt4-qt3support libqt4-x11 libx86 php5-gd python-qt python-qt4 qt3 splashy suspend t1lib

For example, this is from ubuntu hardy, and shows the X11 library dependencies of php-gd.

Package: php5-gd
Source: php5
Version: 5.2.4-2ubuntu5
Depends: libc6 (>= 2.7-1), libfreetype6 (>= 2.3.5), libgd2-xpm (>= 2.0.35.dfsg), libjpeg62, libpng12-0 (>= 1.2.13-4), libt1-5, libx11-6, libxpm4, php5-common (= 5.2.4-2ubuntu5), phpapi-20060613, zlib1g (>= 1:1.2.3.3.dfsg-1)
Description: GD module for php5

To remove all those packages, you'll have to remove everything that depends on them also.