How to uninstall a desktop environment

I have manually installed XFCE, and don’t quite like it. Also I have a problem which I think is related to the newly installed DE. When I downloaded Chrome from google and tried to install it by clicking on the .rpm, I always get an error “failed to install, query invalid”. I then right clicked the file and found the default install application is “apper installer”, which also had a gnome like GUI. If I choose “install/uninstall software” instead, I can install the .rpm normally. Besides, some application icons changed which I don’t know if it’s XFCE’s fault.

All in all, I’m now trying to remove XFCE. But “zypper rm xfce” would result in “can’t find pkg xfce”. In YAST, I couldn’t figure out how to “delete” XFCE. There is only “not install” option when right click on XFCE.

Hoping that you have other desktops on your machine you open YaST and select patterns and select xfce and uninstall all the related packages.

That is a bit to easy. Because the pattern will e.g. include X because that is needed for XCFE, but uninstalling it would criple all other DEs. So when any deendancy issues are shown, never say Yes!

IMHO the best thing is to simply not use that software. It is only a few MB sitting on disk and normaly not worth all the trouble to find out what can and what can not be deinstalled without problems. Then at the next big uograde (to openSUSE 13.1 or so) reinstall (and of course keep all personal data in /home and the like) and you will have a cleaning action automaticaly then.

You can try

zypper rm -u *xfce4*

and afterwards

zypper ve

to verify that your system is consistent.

Did you ever try this? Can you explain what it does? That means first and foremost, what does the shell expand this pattern into? And then maybe we would understand what the arguments are that are fed into zypper.

zypper rm -u *xfce4*

You can read man zypper for explanation.

rm = remove packages
-u = --clean-deps = Automatically remove unneeded dependencies.
xfce4 = Select all packages with “xfce4” in the name.

“zypper ve” because I’m not sure whether a non-xfce4-system needs though some packages from xfce4.

When you want to feed the string xfce4 into zypper, you have to prevent the shell from interpreting it. Thus:

zypper rm -u '*xfce4*'

The only thing that probably makes this functioning for you is the fact that there is no file in the working direrctory where you are at that moment, that fits into that pattern. Else you would have a strange effect. And better save then sorrow. Particularly while you do this as root and thus any eror of such kind can be fatal to your system.
Try to understand the following:

henk@boven:~/test/fff> ls -l
totaal 0
-rw-r--r-- 1 henk wij 0 18 mei 12:36 aapxfce4noot
henk@boven:~/test/fff> echo *xfce4*
aapxfce4noot
henk@boven:~/test/fff> rm *xfce4*
henk@boven:~/test/fff> echo *xfce4*
*xfce4*
henk@boven:~/test/fff>

Thanks for explanation :slight_smile: Will add those single quotes in future
If i want to pass multiple then should i use the following ?

 zypper rm -u '*xfce4*' '*qt*'

Yes, you are right. I forgot to set single quotes. Thanks for clarification.

You can try it out. It works:

zypper rm -u '*xfce4*' '*qt*'
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW packages are going to be installed:
  NetworkManager-openvpn-gnome NetworkManager-pptp-gnome NetworkManager-vpnc-gnome 

The following packages are going to be REMOVED:
  FDesktopRecorder NetworkManager-kde4-libs NetworkManager-openvpn-kde4 NetworkManager-pptp-kde4 NetworkManager-vpnc-kde4 
  akonadi akonadi-runtime akregator amarok appmenu-qt ark bluedevil bluedevil-lang choqok clementine converseen crystal 
  digikam digikam-doc dolphin dropbox-servicemenu dvgrab enblend-enfuse exiftool exo-branding-openSUSE exo-data exo-lang 
  exo-tools flash-player-kde4 frei0r-plugins fsrunner gstreamer-0_10-plugins-qt gwenview hplip hugin imagewriter k3b 
  k3b-codecs kactivities4 kaddressbook kaffeine kamerka kate kcalc kcharselect kcolorchooser kde-gtk-config 
  kde-gtk-config-lang kde4-kgreeter-plugins kde4-print-manager kdeartwork4-screensaver kdebase4-libkonq kdebase4-nsplugin 
  kdebase4-openSUSE kdebase4-runtime kdebase4-runtime-branding-openSUSE kdebase4-session kdebase4-workspace 
  kdebase4-workspace-branding-openSUSE kdebase4-workspace-ksysguardd kdebase4-workspace-liboxygenstyle 
  kdebase4-workspace-plasma-calendar kdelibs4 kdelibs4-branding-openSUSE kdelibs4-core kdenetwork4-filesharing kdenlive 
  kdepasswd kdepim4 kdepim4-runtime kdepimlibs4 kdf kdialog kdm kdnssd keditbookmarks kgamma kget kgpg kio_audiocd kio_iso 
  kio_kamera kio_mtp kio_sysinfo kipi-plugins kipi-plugins-acquireimage kipi-plugins-geolocation klinkstatus kmag 
  kmahjongg kmail kmines kmix kmousetool kmplayer kmplayer-lang knotes kompare konqueror konqueror-plugins konsole kontact 
  konversation konversation-lang kopete korganizer kpat krdc kreversi krfb kruler krusader krusader-doc kscd ksnapshot 
  ksshaskpass kstreamripper ksudoku ktorrent kvkbd kwalletmanager kwebkitpart kwin kwrite lensfun-data libQtGLib-2_0-0 
  libQtGStreamer-0_10-0 libQtWebKit4 libakonadi4 libakonadiprotocolinternals1 libattica0_4 libbluedevil1 
  libboost_filesystem1_49_0 libboost_regex1_49_0 libboost_signals1_49_0 libboost_system1_49_0 libchm0 libdbusmenu-qt2 
  libdiscid0 libdjvulibre21 libdvbpsi7 libebml3 libepub0 libexo-1-0 libfluidsynth1 libgavl1 libgle3 libglut3 libgpod-tools 
  libgpod4 libgrantlee_core0 libgrantlee_gui0 libkactivities6 libkcddb4 libkcompactdisc4 libkdcraw22 libkde4 libkdecore4 
  libkdegames6 libkdepim4 libkdepimlibs4 libkerfuffle4 libkexiv2-11 libkface1 libkgapi0 libkgeomap1 libkipi10 libkmahjongg 
  libkmahjongglib4 libkolab0 libkonq5 libksane0 libksuseinstall1 libktexteditor libktorrent5 libkvkontakte1 liblastfm1 
  liblensfun0 liblqr-1-0 libmarblewidget15 libmatroska5 libmeanwhile1 libmediastreamer1 libmediawiki1 libmlt++3 libmlt5 
  libmlt5-data libmlt5-modules libmsn0_3 libmusicbrainz3-6 libmygpo-qt1 libmysqld18 libnepomukwidgets4 libntrack-qt4-1 
  libopencv2_4 libortp8 libpano13-2 libpgf6 libphonon4 libpolkit-qt-1-1 libpoppler-qt4-4 libprison0 libprotobuf-lite7 
  libproxy1-config-kde4 libqca2 libqimageblitz4 libqjson0 libqoauth1 libqt4 libqt4-qt3support libqt4-sql libqt4-sql-mysql 
  libqt4-sql-sqlite libqt4-x11 libreoffice-kde4 libsoprano4 libstrigi0 libtag-extras1 libupnp6 libvlc5 libvlccore5 
  libwx_baseu_xml-2_8-0-stl libwx_gtk2u_aui-2_8-0-stl libwx_gtk2u_gl-2_8-0-stl libwx_gtk2u_richtext-2_8-0-stl 
  libwx_gtk2u_xrc-2_8-0-stl libxcb-composite0 libxcb-xv0 libxfce4ui-1-0 libxfce4ui-branding-openSUSE libxfce4ui-lang 
  libxfce4util-lang libxfce4util6 libxfconf-0-2 libxine2 libxine2-codecs libxine2-pulse libxmi0 libyui-qt-pkg4 libyui-qt4 
  libzip2 luckybackup marble marble-data marble-doc melt melt5 mkvtoolnix moodbar mozilla-kde4-integration nepomuk-core 
  okular opera-kde4 p7zip patterns-openSUSE-kde4 patterns-openSUSE-kde4_basis patterns-openSUSE-kde4_games 
  patterns-openSUSE-kde4_imaging patterns-openSUSE-kde4_internet patterns-openSUSE-kde4_laptop 
  patterns-openSUSE-kde4_multimedia patterns-openSUSE-kde4_office patterns-openSUSE-kde4_pure 
  patterns-openSUSE-kde4_utilities patterns-openSUSE-kde4_utilities_opt patterns-openSUSE-kde4_yast 
  patterns-openSUSE-sw_management_kde4 perl-Archive-Zip perl-File-RandomAccess perl-Image-ExifTool perl-URI 
  phonon-backend-gstreamer-0_10 pinentry-qt4 plasma-addons plasma-addons-lancelot plasma-addons-marble plasmoid-folderview 
  plasmoid-networkmanagement plasmoid-quickaccess polkit-kde-agent-1 polkit-kde-kcmmodules-1 python-M2Crypto 
  python-distribute python-kde4 python-kdebase4 python-pyudev python-qt4 python-sip qt4-qtscript qupzilla skanlite 
  skanlite-doc smplayer soprano soprano-backend-redland soprano-backend-virtuoso sqlite3 streamripper strigi sweeper 
  synaptiks taglib unetbootin virtualbox virtualbox-guest-kmp-desktop virtualbox-host-kmp-desktop virtualbox-qt vlc 
  vlc-noX vlc-qt vokoscreen xfce4-power-manager xfce4-power-manager-lang xfconf xfconf-lang xscreensaver-data-extra yagf 
  yakuake yakuake-lang yast2-control-center-qt yast2-qt-branding-openSUSE yast2-scanner yast2-theme-openSUSE-Oxygen 
  yast2-tv 

3 new packages to install, 324 to remove.
Overall download size: 131.5 KiB. After the operation, 1.0 GiB will be freed.
Continue? [y/n/p/?] (y): n

it did work for me but wanted to clarify it because i simply did

zypper rm -u *package1* *package2*

in past without any quotes

On 2013-05-18 12:26, zerum wrote:
> xfce4 = Select all packages with “xfce4” in the name.

Not exactly.

It first selects all filenames in the current directory that match the
shell expansion pattern you give, and then, the result is passed to the
zypper command.

This is a subtle but crucial difference between MSDOS and Linux.

Look:


cer@Telcontar:~/tmp/test> touch somethingxfce4
cer@Telcontar:~/tmp/test> su
Password:
Telcontar:/home/cer/tmp/test # zypper rm --dry-run *xfce4*
Loading repository data...
Reading installed packages...
'somethingxfce4' not found in package names. Trying capabilities.
No provider of 'somethingxfce4' found.
Resolving package dependencies...

Nothing to do.
Telcontar:/home/cer/tmp/test #

but...

Telcontar:/home/cer/tmp/test # rm somethingxfce4
Telcontar:/home/cer/tmp/test # zypper rm --dry-run *xfce4*
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW packages are going to be installed:
exo libxfce4panel-1_0-3 libxfce4ui libxfce4ui-branding-upstream
libxfce4util libxfcegui4

The following packages are going to be REMOVED:
exo-tools libexo-1-0 libgarcon-data libgarcon-lang libxfce4panel-1_0-4
libxfce4ui-1-0 libxfce4ui-branding-openSUSE libxfce4ui-lang
libxfce4ui-tools libxfce4util-lang libxfce4util6 libxfcegui4-4
libxfcegui4-data
libxfcegui4-lang libxfsm-4_6-0 orage-doc patterns-openSUSE-xfce
patterns-openSUSE-xfce_basis patterns-openSUSE-xfce_office
ristretto-lang xfce4-appfinder xfce4-appfinder-lang xfce4-dict
xfce4-dict-lang
.....
17 packages to downgrade, 6 new, 105 to remove, 17  to change vendor.
Overall download size: 7,9 MiB. After the operation, 32,9 MiB will be freed.
Continue? [y/n/p/?] (y): n^CTelcontar:/home/cer/tmp/test #

Do you see the difference?


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

For the shell part of the interpretation that is OK, it will not change anything (except removing t he ’ ’ at the end of the interpretation. Then comes zypper and if zypper allows this you must findd in the zypper documentation (man zypper). But I see that zerum already toold and proved that zypper is able do do this.

Never forget with everything you type in the CLI, that you actualy type it into a shell (most use bash) and that the shell is doing a lot of interpretation first before it the asks the Kernel to start a program (zypper in this case) with it’s arguments. When you forget that, there will be all sorts of surprises. Normaly those surprises will be harmless, but when you are root …

As “hcvv” and “robin_listas” explained it works without quotes when there is nothing in $PWD that matches the search string. The save and correct way to use wildcards is to set them in quotes.

I hope you see that the fact that this “works” (a very vague term, often meaning: it does what I expect that it should do) because of the default action of the shell.

When the pattern matching results in no matches, the shell keeps the original token. There is an option to bash to use another action: when the result is zero matches, remove the original token, thus the result will be nill. Read it all in the man page of bash (though I admit that it is long and not allways easy to understand and certainly not easy to find subjects, but hen again, it isn’t a teaching document, it is a definition document).
In this case search for the paragraph called Expansion and then for the sub-paragraph Pattern Matching.