Custom Debian systems

Ever set up a new Ubuntu installation only to then attempt to remove most of the installed packages? I have, when I wanted to put a small, fast-to-boot, command-line only live Linux system on the backup hard drives to facilitate backing up the computer without an optical drive. And it was a real pain, because I pretty soon had a broken Ubuntu system which nevertheless had a lot of clutter left behind from packages that I didn’t even know were there until I removed a dependency thereof. Fortunately I gave up on trying to “slim down” an Ubuntu system and turned to Google for an answer.

This should have been much easier to find, but it wasn’t, and that’s why I’m posting it here: Debian. Debian live, to be precise. Yes, unless you specifically choose a version that includes a graphical desktop, you get just a basic command-line interface with a number – but not an excessive number – of common Linux tools included. Exactly what I needed.

But the real power of this “base” Debian system is not how little software comes pre-installed, but rather how much software is available. You’ve got the full Debian package repositories available – the same repositories that projects such as Ubuntu are based off of – and combined with the slim system that you get either in the live environment or after installation, you’ll be building up your perfect system from modular blocks rather than stripping it down from a pile of bloat.

Case in point: today I needed to set up a small temporary server with just SSH, Apache, and PHP, nothing else. Last time I had done this, I had performed a full Ubuntu install, then installed the server software separately, then removed the desktop environment simply to stop the graphical login screen from launching after I had disconnected the monitor and crashing the system (I’ve had that happen before on headless Linux systems). But I didn’t actually succeed in stopping the graphical login screen, just removing it. In other words, the init system crashed when I rebooted the server because the login screen was trying to launch but couldn’t be found. So then I just manually deleted the init scripts to launch the graphical login, but in the process effectively broke the package manager from ever being able to install a package that included an init script (fortunately I had installed SSH and Apache beforehand).

Today, however, I just did a Debian install over the network (the Debian install was quicker than the Ubuntu install), rebooted the new server, logged in as root, and ran “apt-get install apache2 libapache2-mod-php5” (I think the installer had already prompted me if I wanted an SSH server, and I said yes). Then I rebooted again, and I had a server that did just what I wanted and as a bonus it booted up in about 10 seconds – and didn’t crash when I unplugged the monitor.

But it’s not just lightweight servers that building a custom Debian system like this is great for, it’s also great for when you want a system that’s got everything you need but nothing that you don’t need. Recently I’ve switched from Linux Mint to Ubuntu MATE, and both of them had stuff that I didn’t want: Linux Mint had THREE music players, while Ubuntu MATE had one – the wrong one – and the whole Ubuntu One thing that I had to dig out (the good part is that it was easy to dig out – now I just need to remember exactly what I removed and how I removed it for when I do another install on my new PC build in a few days’ time). In short, both systems needed a lot of “tweaking” to get them just right; with Debian, that isn’t necessary.

It’s hard to describe the true flexibility that having such a basic system to work from gives you. Granted, you’ll find that some common Linux functionality that we take for granted these days is missing (most notably the bash completion isn’t what we’ve come to expect and the “sudo” command is noticeably absent), so you’ll need to install that separately, but when you really want to be in control of your system, there’s no other way to go. Thanks to the excellent package management system, Debian gives you the flexibility to leave out what you don’t want but to easily install exactly what you do want – be that a whole desktop environment or just an HTTP server.

I just don’t know why this wasn’t easier to find out – once I was so stupid that I thought I had to compile everything from the source code just to get a system that didn’t include an X server!

Sometime I also hope to write a tutorial on setting up a Debian system of this nature – stay tuned!

UPDATE: All three parts of the tutorial are now online, and you can read the first part here.


Leave a comment...

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s