My blog post title naturally refers to “the size of one’s Centos installations”, in case it wasn’t obvious!
Centos (and therefore Red Hat and its other clone cousins) installs a dirty great big Gnome system by default, complete with software such as OpenOffice.org, which I wouldn’t have said was exactly essential on a server! So how minimal can you get a Red Hat/Centos/etc installation, whilst nevertheless retaining a highly functional OS (so you have a file manager and an Internet browser so on, not just a bare command line?), that is additionally capable of running something like Oracle?
I’ve played around with this question quite a bit over the years, and here’s my not-so-secret recipe for svelte-ish Centos.
The first and most important thing to do is to make sure you customise your list of packages during the OS installation process itself… and de-select absolutely everything, including the Base group.
So, for starters, de-select “Desktop – Gnome” and select “Customize now” on this screen:

Once you click Next, you’ll be taken to this screen, where you work through the list on the left and de-select anything that’s been selected by default in the right-hand panel:

You’ll notice here that I’m de-selecting the Base package group, but there are about a half-dozen other groups that are selected by default lurking under the Applications and Servers groups, so un-check those, too.
Now you can go ahead and complete the OS install: it should only take around 3 minutes. When you reboot, you’ll have to log on at a command prompt (as root), at which point you can check how slim you’ve managed to get things:

That’s a 677MB installation of Centos 5.6 (64-bit), sitting on a suitably modest 1.9GB root partition – and that’s probably about as small as you’ll ever get a Red Hat-type OS to be (Ubuntu Server can be about half that size, by way of comparison). I’ll therefore call this the “minimal OS” and I’ll use it as the base onto which each of the options described in the rest of this blog piece will be installed.
A 677MB O/S is a good start, I suppose …but it’s not really usable, is it? Not unless you are a command-line loving guru, anyway. So how, minimally, to get a GUI-ish environment added to your 677MB starter OS? Well, there are a couple of options here.
Option 1 : Drastically Minimal
For truly minimal results, having logged on as root, type this command:
yum install xorg-x11-server-Xorg xorg-x11-xinit twm nano xterm
That should prompt you to perform a 34MB download/install, comprising about 40+ packages.
You may now need a quick edit of your default /etc/X11/xorg.conf file: mine had a section which mentioned driver=”vmware”. Because I hadn’t installed guest additions in my virtual machine at this point (because we’re being minimalist, right?!), that would not work. Change it to driver=”vesa”, however, and you’ll be good to go.
Now, you should be able to issue the command:
startx
…which will get you this:

This is the twm window manager, which is as basic (and horrible) as it’s possible to get. Left-click anywhere on the desktop and that sickly-green menu will appear, which contains ‘kill’ options to let you shut something down and an ‘xterm’ option to let you open up a terminal session. From the terminal, of course, everything is possible… indeed, I well recall using exactly this interface back in 2004 to install from scratch a two-node RAC in New York from a Sydney office. So, the functionality is certainly there, if you are able to grit your teeth hard enough. You’ll note from the screenshot that we’re now up to 865MB used on my root partition… still fairly svelte, for Red Hat-based distros, I think.
If you’re going to install Oracle on this box, you may well want to do it by using the Gladstone preinstallation script… and that’s fine. But you’ll first need to issue this command:
yum install redhat-lsb
…which adds another 14MB or so to the server.
Of course, you’ll then be needing an Internet browser to download Gladstone in the first place: the simplest approach, I think, is to do a
yum install firefox
… (though it costs another 75MB of download, including a lot of Gnome-related ‘litter’). You run the browser subsequently by opening an xterm and typing the command firefox, after which everything’s pretty standard fare.
You won’t be able to right-click the downloaded Gladstone shell script to alter its permissions, of course: old timers won’t be surprised to know, however, that a chmod 775 gladstone.sh at the command prompt will achieve the same thing.
Option 2 : Getting Fairly Maximal
If the delights of twm seem a bit too minimalist for you, there is a slim-ish alternative: Xfce. This is the desktop environment that Xubuntu uses (for one): it’s claimed to be lighter on resources than Gnome or KDE and therefore a lot faster than either. However, it uses a lot of the same libraries that Gnome uses, so I’m not really convinced that choosing it over bog-standard Gnome is hugely worthwhile: I mention it here only because it’s a nice way of showing what you can get on Centos without completely buying into Gnome.
Assuming you’re prepared to give it a whirl, however, you’ll find that it’s very simple to install in your “minimal OS” install. Just issue the commands:
yum groupinstall "XFCE-4.4"
yum install xorg-x11-xinit xorg-x11-server-Xorg
That will trigger a somewhat less-than-svelte 123MB download, involving around 200+ packages. It takes a while, therefore, to get installed. It’s also true that I again needed to edit my /etc/X11/xorg.conf to change the driver from “vmware” to “vesa”; but once I’d done that, I simply had to type the command:
startxfce4
… to get this:

Now that’s a proper GUI, complete with the Thunar file manager and a truly graphical terminal. Any Gnome or KDE user would, I think, feel rapidly at home here. But look at the disk usage figures on the root partition in that screenshot: we’re now using 1.2GB of disk space, which is quite a jump from the 677MB starting-point. It’s a lovely GUI environment, therefore… but it’s not exactly “lightweight”, not in the extreme sense meant in this article, anyway.
Option 3: The Best of Both Worlds
Happily, there’s no reason why you have to install the entire XFCE desktop environment just to get some of its nicer tools (like the Thunar file manager). If you do the Option 1 route I’ve described above, there’s nothing to stop you simply typing:
yum install thunar
A mere 13MB later and you’ll be able to run the very GUI file manager by issuing the command thunar in an x terminal session. Stick an ampersand on it (i.e., type thunar &) to make it run in the background, freeing your xterm for other work in the foreground.
And that’s pretty much the way I like my Red Hat/Centos/Scientific Linux boxes to run when I use them as an Oracle database server: minimal install, add in a couple of X-related packages, add twm, add Firefox, Thunar and redhat-lsb … done! That all takes up a mere 1.1GB, but makes a perfect platform on which to run Gladstone and then install Oracle.
There are other non-Gnome, non-KDE window managers, of course. Fluxbox is nice; icewm is attractive; ratpoison is ghastly in a 1970s pre-GUI way… but very, very functional. Not all are easy to install on Centos, since they’re not always in the standard repositories, but they’re all do-able with various degrees of difficulty. But I’ll settle for what I’ve described here: it means I can manage the servers when I have to, but know otherwise that nothing’s getting between my databases and my CPU cycles unnecessarily!