I have recently inherited an old laptop with only 512mb of ram (shared with video). I noticed that my media editing desktop monster with all the compiz eye candy etc. uses 300mb of ram just to sit idly on the desktop and I thought "that kind of install will not cut it on the lappy".
So I decided to have a go at installing a minimalistic ubuntu, installing only the components I definitely needed, from the ground up (I call it "ground up ubuntu" - yay coffee metaphor!). Some of the steps involved were less than obvious (hence writing a tutorial for it), but the result was a fully functional desktop with a 40mb memory footprint. Not at all bad. This process is still fairly easy with Ubuntu, but I did learn a lot about how the components of a linux desktop fit together in the process.
This is my first time writing a tutorial like this, so go easy, I'm happy to make corrections.
Step 1: Install base system from Alternate CD
You'll have to grab the Alternate CD (latest at time of writing is 9.04 Jaunty) to install the base system (no desktop, no lamp stack, pretty much just enough to use apt-get).
1.1 - Preamble
After booting the Alternate CD, select your language then choose Rescue a Broken System from the menu. You'll have to tell it your country and your keyboard layout, then it will configure a bunch of stuff including DHCP, so you have network access. Next you'll have to choose a hostname and set up your time zone info. Finally a bunch of hardware detection occurs.
1.2 - Partitioning and Installation
At this point, you'll be shown some info about the partitions detected (or not detected) on the system. Whichever it is, choose Go Back to be taken to a list of system rescue tasks. Choose [b]Install Base System[b] from the list. From here the steps are very similar to the standard ubuntu desktop install, just follow the instructions to set up partitions and install the base system.
Step 2: Adding a Desktop Environment
After you finish installing the base system and reboot, you're left with a login prompt. Enter your username and password and you get given a command line. This is technically a complete linux system, but doesn't let us do much. We need to add a few things in order to make our computer feel like it belongs in the post 1970s.
2.1 - X Server
An X server is the program that actually displays a graphical desktop on your linux machine, to install one, run the following command:
Code:
sudo apt-get install xserver-xorg xinit
xinit is primarily useful for giving us the startx command which actually starts up the X server. However, if we run startx now, X will terminate and drop us back to the command line. Why? Because we have no window manager to take over control once X starts.
2.2 - Window Manager (fluxbox)
Since we're going for a lean and mean install, I chose to use fluxbox for the window manager. It's very lightweight and makes me feel hardcore (since it is much more expert friendly than joe average friendly). If you don't like fluxbox, feel free to modify this step to your tastes (maybe try xfce).
As well as fluxbox, we're going to need to install a terminal emulator so that we can use the command line to do other tasks once fluxbox has taken over and we lose our current command-line. To install fluxbox with a terminal emulator, use these commands:
Code:
sudo apt-get install fluxbox xterm
With that done, we can load our shiny new desktop by running:
Once you're in the fluxbox desktop environment, you can run programs by right-clicking the desktop and finding them in the menu, or the faster way, but pressing Alt-F2 to get the run dialog and just typing the name of the program you want to run. To get the terminal emulator up so we can install more stuff, press alt-F2 and enter xterm
Step 3: Adding a file manager
There are lighter weight file managers out there, but they hurt my eyes, so I chose to install thunar. Be aware that it does drag in some xfce dependencies and if you really need to keep things super-light, there are some other options like xfe.
3.1 - Installing thunar
Install thunar with the simple command:
Code:
sudo apt-get install thunar
3.2 - Making it not ugly
If you run thunar, you may notice that all the icons are the same dinky piece-of-paper thing. This is annoying. If i wanted no graphical description of my files, I'd have stuck with the command line, so we're going to fix it. We're going to install an icon theme called tango and a theme chooser app for gtk programs (like thunar). Enter these commands:
Code:
sudo apt-get install tango-icon-theme lxappearance
After these have been installed run lxappearance by just typing its name at an Alt-F2 prompt, then you can select you're preferred gtk theme, icons, etc.
Step 4: Adding Sound Capabilities
This one caused me some headaches. After reading a lot of hype lately about the new and improved Open Sound System version 4 (OSSv4), I decided that it must be my new lightweight sound solution. I installed it, and it seemed to work fine, but the promised benefits were not there.
If I turned on virtual mixing, I got bad crackly sound with low volume, if I turned it off, I could only get one application to play sound at once. So I decided to revert back to ALSA (which as it turns out, was easy and not so bad at all).
4.1 - Installing ALSA
To install ALSA and enable sound, install these packages:
Code:
sudo apt-get install alsa-base alsa-utils
4.2 - Adding ourselves to the audio group
Next we need to add our user to the audio group so that our apps can access the sound card:
Code:
sudo usermod -a -G audio your_username
To get these permissions to apply, we need to log out and log back in. Right-click the fluxbox desktop and select Exit in the menu. This will end the X session and drop you back to your original command line. From here, use the command:
to log out and then log in again as normal. Use the command:
again to get back into fluxbox.
Step 5: Adding some basic applications
I installed some basic applications to enable me to actually get stuff done with this machine:
Code:
sudo apt-get install firefox mplayer audacious abiword gnumeric evince eog geany xarchiver
Firefox: web browser
Mplayer: media player with heaps of options
Audacious: Winamp-like music player
Abiword: Word Processor
Gnumeric: Spreadsheet App
Evince: PDF viewer
Eye of Gnome: Image Viewer
Geany: Text Editor/Simple Programming IDE
Xarchiver: gui frontend for several archive file types
Step 6: Tweaks
This is just some stuff to make the computer a little more user friendly.
6.1 - Being able to set wallpaper in fluxbox
By default, there is no proper wallpaper setting application in fluxbox, to get one, run the command:
Code:
sudo apt-get install feh
To actually set the wallpaper, run a command that looks like this:
Code:
fbsetbg -f /path/to/image.jpg
It is also a good idea to edit your fluxbox init file so that the previously set wallpaper is loaded again each time you start fluxbox. Open the file with:
Code:
geany ~/.fluxbox/init
add the line:
to the end, save and close.
6.2 - Current Battery Level
If you're installing on a laptop like me, you'll want a way to see the current battery level, time left to recharge, etc. Install the acpi tool with:
Code:
sudo apt-get install acpi
To run the tool and see the current batter stats, simply run:
at the command line.
Step 7: Checking the Memory Footprint
With all this stuff done, its time to see the fruits of our labour and see just how little memory our new lean-and-mean, ubuntu-from-the-ground-up system uses.
7.1 - Install conky
Conky is a nifty and lightweight little system monitor, install it with:
Code:
sudo apt-get install conky
7.2 - Check your results
Reboot so you get a picture of your system truly at idle, no extra apps running. To do this, use the command:
Code:
sudo shutdown -r now
The -r means reboot, if you want to shut the system down, use -P instead (note uppercase P).
After the reboot, login, run startx, then run conky with Alt-F2, it will tell you your current memory usage, cpu usage, chunkiest apps, etc. Come here and tell us all your results!
I get 40.75Mb of memory in use after a clean boot.
Wrapping Up - Some Notable Exclusions
Here's some of the stuff that I notably skipped installing.
A Login Manager (gdm, kdm, etc.)
who needs it? I'm happy logging in from a command line and then running startx. You might even fool some n00b into thinking that this is a text-only install.
Pulseaudio
When I go to do the ground-up install of my big, media editing, desktop machine, I'll no doubt need pulseaudio for some stuff, but for this little lappy, I don't see the point. If for some reason I ever decide I need to be able to watch a movie and listen to music at the same time, I'll just live with them being at the same volume all the time
Bookmarks