Tuesday, April 5, 2011

Minimal openSUSE 11.1 install

Introduction

Every distribution has its goals and purpose. Some are designed to include everything, others like to take a small selection of what's available. But all distributions start from a small base and install more and more packages until they have a complete environment. For some that's GNOME or the latest snapshot of KDE 4, while for others it is a tiny footprint with the most lightweight window manager. As many readers will be aware, I like minimalist systems and wrote an article for DistroWatch Weekly on how to get a more lean Ubuntu system. Some readers however, thought I was stupid to choose Ubuntu if I wanted a light-weight system and claimed other distros were faster and better. Undoubtedly so, but I didn't choose it because it was lightweight, quite the contrary. I chose it because, by default, it's pretty hefty and like it or not, it is the most popular desktop distribution at the present time. The article intended to show that you don't have to be stuck with the Ubuntu way of doing things and that you could take control. You can do this with almost any distribution out there and today I'll show you how to do so with openSUSE.

openSUSE is a great distribution with a great community. It has a rich heritage and a powerful configuration system in YaST. By default, openSUSE comes with three different environments, GNOME, KDE and Xfce. The installer is one of the most well-respected in the business, which also gives you the option to install a base system. For this article I used the openSUSE 11.1 x86_64 DVD on a computer with an Intel Core2 E8400 3 GHz CPU, 8 GB of memory, 750 GB SATA hard drive and a NVIDIA 8800GT video card.

Installation

Boot to the DVD and choose to install from the menu. You can press F2 and select an alternate language if required. The system will boot straight into the installer, where you should begin your 'New Installation'. I chose to use the automatic configuration option and proceeded to set my time zone. At the 'Desktop Selection' screen hit the 'Other' button and choose either 'Minimal X Window', or 'Minimal Server Selection (Text Mode)'. The first option will install the base system, plus the X Window server and the basic desktop environment, Tab Window Manager (TWM). If you want less control then take this one, but if you want more, then take the second text-mode option.
Partition your hard drives however you desire - I like to turn off access time and so select 'No access time' on a per-partition basis. Create a user (I turn off automatic login), complete the rest of the setup procedure and begin the install. If you took the second option, then at the summary screen ensure you change the default run level from 3 to 5 (full multi-user with network and display manager). This entire install process took only 6 minutes to complete and a further 2 minutes to configure the system on first boot. If you took the first option, then by default it will boot straight to the X Window desktop manager and the basic TWM desktop. You can log into this environment as root or switch to a terminal if you prefer. Unlike Ubuntu, the base openSUSE system includes a fully functional splash screen and includes many services, such as D-Bus, HAL, Firewall, CPUFreq, NFS, CUPS, OpenSSH and Postfix out of the box. It also includes YaST and all the modules for configuring your system. Next we can begin to tweak the system.

Base system

Now that you have a basic X Window system installed (if you don't yet, you will shortly), we can use the Internet to download the latest packages. Any packages that have been updated since the initial release will be installed from the Internet, while anything else will be installed from the local DVD. By default the openSUSE installer will have configured your repositories for you; however, you can use a custom mirror if you like. To accomplish this, I use Zypper, openSUSE's powerful RPM package management tool.

List the repositories.

# zypper repos


Delete the default Internet repositories, but leave the DVD. Repeat until only the DVD source remains.

# zypper removerepo 2


Add the mirrors you want to use (this takes the form; [command] [option] [path] [name]).

# zypper addrepo ftp://mirror.internode.on.net/pub/opensuse/distribution/11.1/repo/oss OSS
# zypper addrepo ftp://mirror.internode.on.net/pub/opensuse/distribution/11.1/repo/non-oss non-OSS
# zypper addrepo ftp://mirror.internode.on.net/pub/opensuse/update/11.1 updates

Whether you changed the mirrors or not, let's now update the system.

# zypper refresh && zypper dist-upgrade


This should provide you with an up-to-date base system. Before moving on, there are some other tasks that you may wish to perform. For me, I don't like to use the search tool Beagle as I find it can slow down the system. You will still require the libraries as many applications are built against them; however, you can lock it easily with Zypper so that it's never installed.

# zypper addlock beagle*


If you are installing on a notebook, openSUSE uses traditional network configuration methods by default, so if you want to use NetworkManager it's easy! First, install it.

# zypper install networkmanager


Next, tell YaST to configure it as the default network manager.

# yast2 sysconfig set NETWORKMANAGER=yes

Environment

Next, let's get a basic desktop environment. There are groups you can install under openSUSE, called 'patterns', which pull in packages as specified by the package maintainer. For example, if you want a basic GNOME or KDE desktop, you can install 'gnome_basis' or 'kde4_basis' respectively. KDE3 is also available with 'kde3_basis'. The problem with using these is that you forfeit some control and minimalism for your system as many packages are pulled in for you. The upside is that you don't need to know each and every little package to make everything work, which can be frustrating if you want something but don't know how to get it! Feel free to experiment, but for the purposes of this exercise, here is how to use the available patterns.

# zypper install -t pattern gnome_basis


This will pull in all required packages to get you a default openSUSE configured desktop.

If you took the text mode option during install time and do want a more minimal desktop, perform the following instead.

# zypper install gdm gnome-terminal xorg xorg-x11-driver-input xorg-x11-driver-video xorg-x11-fonts yast2-gtk
# cp /etc/X11/xorg.conf.install /etc/X11/xorg.conf


By default, openSUSE will continue to boot the original lightweight window manager and so we need to tell it to switch to GNOME. This is done either by editing the respective configuration file under /etc/sysconfig/ or via YaST. We'll use YaST.

First, set the login manager (if you want to).

# yast2 sysconfig set DISPLAYMANAGER=gdm


Next, change the default desktop environment.

# yast2 sysconfig set DEFAULT_WM=gnome


Reboot your computer and you should be greeted with the openSUSE GNOME Desktop Manager. Log in as the user you set up during installation and it should load the GNOME desktop.

Now that you have a fully functioning GNOME environment, you can continue to install any other applications you require and tweak your system further. The pattern we used has pulled in many of the basic packages we need, including a web browser, email and calendar program, chat client, CD burner and an image viewer. If you didn't use the pattern, then you'll need to install the packages you want manually. There are many other ways to tweak your system further of course, now that it is installed. Try disabling unused services, removing programs you don't need and introducing some package locks.

This new custom openSUSE system boots from GRUB to login screen in around 28 seconds, taking a further 6 seconds to load the GNOME desktop. It is using up 175 MB of memory once fully logged in and just over 1.7 GB of hard drive space. Compare this to the default install, which takes 39 seconds to boot and over 10 seconds to load the desktop, while using up 3.6 GB of hard drive space and over 315 MB of memory.

Conclusion

If you want a really light weight environment then openSUSE might not be the way to go, but if it's your favourite operating system, you don't have to give it up just yet! You can tweak the system to make it quite small, especially with the help of Zypper and its ability to lock packages. At the very least, you will learn some more about how your openSUSE system works and, if at the end you decide to just install everything, well, you can do that too!

No comments:

Post a Comment