My way of building a minimal desktop on RedHat based systems

This question seems to come up from time to time on forums, and it's also a way for me to remember what I did the last time. The RedHat and clones (as well as Fedora) sometimes have a minimal desktop package group available. In RHEL6, this provided a sort of stripped down Gnome.

I frequently use dwm, a small tiling window manager with few dependencies. I find that I can easily get it installed on Fedora or Alma by adding a few packages, avoiding many of the extras that RH based installations want to add to my desktop.

First we need the xorg-server, a video driver, and drivers for mouse and keyboard. I like to boot into runlevel 3, then run startx, so I will also need xinit. Lastly, I'll need a terminal.
dnf -y install xorg-x11-server-Xorg xorg-x11-drv-{evdev,intel,synaptics} xorg-x11-xinit liberation-fonts

That should be all one line.

My laptop has an onboard Intel video card. Change that to fit your machine's video card. If you have an NVidia, there's a good chance the nouveau driver is already there. You can check that with rpm -qa |grep nouveau. To be sure of getting something, even if it doesn't work that well, you can use the vesa driver. So you would change the "intel" in the above command to read "vesa". If you don't have a touchpad that works with the synaptics driver, you should just need the evdev driver--there's no need for a separate mouse driver so you can leave out "synaptics". As of Fedora 26 synaptics has been replaced by libinput, so you can change synaptics to libinput in the line above. I prefer openbox as my window manager and urxvt as my terminal. In RHEL9, at least, to get these, I first have to add the epel-release repos.
dnf -y install epel-release

There are probably other fonts that work as well as liberation, but I like it.

When this is done, you should have an X environment. At this point, you can install your window manager of choice. If using Fedora, it's probably available using dnf install. (This holds for dwm and openbox, the two window managers that I use the most.) If on Alma or another RH clone, openbox at least, is in the epel repos. I have a page on installing dwm, with links to more complete articles, but if we are going to install from source on Alma, we'll need some compiling tools, dwm itself, and a few other programs. I'm not sure if all of these are necessary, but, along with the dependencies they pull in, this is what I use for basic installations on Alma.

dnf install make automake gcc gcc-c++ kernel-devel 

If you're on a fresh install, and haven't yet run dnf update, you may find that kernel and kernel-devel don't match. Check with
rpm -q kernel-devel

The number should match the number of uname -r. If it doesn't, then run dnf update and reboot so that your kernel and kernel-devel versions match. See my page about the problem. In addition, if you're too lazy to scan my dwm page linked above, you will need git to get the source code and a couple of other packages.
dnf -y install git libX11-devel libXft-devel libXinerama-devel

Then you can get dwm with
git clone git://suckless.org/dwm

cd into the newly created dwm directory. You will see a file, config.def.h. Copy it to a file called config.h.
cp config.def.h config.h

Open it in your favorite text editor, and look for the line that says
static const char *termcmd[]  = { "st", NULL };

It's on line 55 in a recent (July 2014) version, but that may change. Change the "st" to "xterm" so that the line reads
static const char *termcmd[]  = { "xterm", NULL };

(The "st" refers to a terminal created by the same people who make dwm, and while it's a good terminal, it's beyond the scope of this article).

Once you've saved the edited file run make && make install and you should have a working dwm. Edit your $HOME/.xinitrc file, creating the file if it doesn't exist, to read
exec dwm

With Fedora, I also have to install terminus fonts, otherwise, I find that several things may not have readable fonts.
dnf -y install terminus-fonts

Run startx and you should be in your new dwm window manager. My dwm page gives links to custom configuration, but if you've taken the defaults, and are unfamiliar with it, hit alt+shift+enter and it should open an xterm for you. From there you can run man dwm to get the default key bindings.

That's a very superficial explanation of dwm, just enough to get a new Alma user up to startx with a working xterm. Once CentOS 7 has been around awhile, I'm sure that the various 3rd party repos will start carrying your favorite window manager. If interested in dwm then see my page linked above for more detailed instructions.

One thing that I've run into, but not consistently, with both Fedora and FreeBSD, is that the startx command will often take a very long time. If startx hangs (but eventually runs) and xinit starts X immediately, the problem may be your /etc/hosts file. Part of the startx command includes running hostname -f, which looks for the FQDN of your hostname. This can often be solved by adding your local host's hostname to /etc/hosts where you have the 127.0.0.1 line and the the ::1 (for ipv6). Where it shows localhost.localdomain (and localhost6.localdomain) insert your local host name so that rather than reading localhost.localdomain it reads something like Lastly, I have a brief page about using AlmaLinux 9 which briefly covers getting tint2 and feh installed.


127.0.0.1  myhost.mydomain  myhost localhost.localdomain localhost