Remove Xfce4 and all GUI packages

Good evening. Can someone please advise how I can remove Xfce4 and all of GUI apps/packages so that I can run Tumbleweed as a headless server (using the cli)? Thank you.

Just boot to multi-user target (runlevel 3)?

The following should clean it out…

rpm -qa xfce* --qf "%{name}
" |xargs zypper rm -u
zypper rm -t pattern xfce
systemctl set-default

As already suggested, your goal (running “headless”) will be satisfied by running in “Miulti-user mode” (YaST > System > System Services; at the top choose Muti User instead of Graphical and reboot).
No need to remove any software.

Thank you. I have been booting into server mode for a while. I have repurpused my Raspberry Pi 4 into a server. I would really like to remove all GUi apps (e.g. browsers including server) so nothing is left behind. When it comes to upgrading Tumbleweed I am downloading loads of packages that I do not require anymore.

I do not know what you mean with “server mode”. When you mean multi-user,target (former runlevel 3) then please use the terms that are native to Unix/Linux and that people are used to. This to avoid confusion.

It is a bit difficult to decide which software packages to remove. Once they are there, there is not really a way to tell why they are there. You could e.g. see in YaST > Software > Software Management from the Patterns View which packages belong to e.g. the Patterns XFCE and X Window system and check all those for removal. But that a package is going to be installed by a specific Pattern does not mean it is not needed by another pattern (or by something outside the Patterns).
Also you may have installed additional GUI packages and those do not belong to any of those Patterns.

E.g. I see Mozilla Firefox mentioned in XFCE Desktop Pattern as well as X Windows Pattern. Meaning that when you remove all packages belonging to XFCE Pattern, you will also remove Firefox and the X Windows Pattern is not complete anymore. It depends then on you to decide if that is OK or not.

IMHO the best thing to do is to handle this at installation. To begin with you can already very early b the installation process decide if you want no desktop and even if you want no X at all. Further you can later in detail add/remove packages from what is proposed for installation. I have done this a few times to install a tex only system.

And as a very personal remark: I would never use Tumbleweed for a, to be rock stable, system which main task seems to be running servers for clients on other systems. And the large and frequent zypper dup sessions that come with Tumbleweed are only one of the arguments.