Ceci est une ancienne révision du document !
1
So Trusty Tahr is out, and, once more, it’s time to think about upgrading our setup, or not. 14.04 is a Long Term Support (LTS) version, so it seems worthwhile even for those less inclined to keep on the “bleeding edge” - if only to stick with it and have some peace for the next several iterations. But while downloading the many hundreds of Megabytes the recent CD images weigh, I always have a tendency to wonder if all these software packages that come as standard are really needed. The full installation of a recent Ubuntu distribution takes up a mere 3GB of disk space. OK, so this is really light compared not only to other operating systems, but even to Linux distributions such as Fedora. But would it be possible to reduce this even further, while maintaining a usable desktop interface? This is not just a philosophical question, though it may strike a cord in the heart of people who (still) believe in the old Unix adage: “Small is beautiful!” Consider: a hard disk installation using as little space as possible will boot up as fast, if not faster than a more loaded one. Just having fewer configuration files and fewer lines in them will give the system a speed advantage when initializing services. Geeky shenanigans like booting up over a network are facilitated, but also the average user's work-flows such as booting from slow media (USB drives, SD cards) - or merely using older hardware.
Ainsi, Trusty Tahr est sortie et, à nouveau, le moment est venu de considérer une mise à niveau de notre machine, ou pas. La 14.04 est une version à support à long terme (LTS) et cela semble donc valoir le coup, même pour ceux qui sont moins enclin à rester à la pointe de la technologie - ne serait-ce que pour la garder et avoir la paix pendant les prochaines itérations. Mais, pendant que je télécharge les plusieurs centaines de Mo que pèsent les images CD récentes, j'ai tendance à me demander si tous les paquets de logiciels qui viennent avec en standard sont vraiment nécessaires. L'installation complète d'une distribution Ubuntu récente prend un petit Go d'espace disque. Ainsi, c'est vraiment léger comparé non seulement à d'autres systèmes d'exploitation, mais même à des distributions Linux telles que Fedora. Serait-il possible de le rendre encore plus léger tout en gardant une interface bureau utilisable ?
IL ne s'agit pas uniquement d'une question philosophique, bien qu'il puisse être en résonance avec les gens qui croient (encore) le vieil adage Unix : « Petit, c'est beau ! » Réfléchissez : une installation sur disque dur qui prend aussi peu d'espace que possible, démarrera aussi rapidement, sinon plus rapidement qu'une qui occupe plus de place.
2
There was a recent editorial on OMG!Ubuntu! titled “Arch: Shangri-La for Ubuntu Power Users?” (http://www.omgubuntu.co.uk/2014/04/arch-shangri-la-ubuntu-power-users). This article by Sam Tran suggested that advanced Ubuntu users could benefit from at least trying out the Arch distribution. Needless to say, the proposal gave the commentators a field day, pointing out that Arch's aims as a distribution are just about in direct opposition to Ubuntu's. Arch gives deeper insight into the gory details of the operating system, while Ubuntu tries to shield the less technical folk from complete exposure to them. Arch gives the system administrator complete power over which software is installed and how it is set up, while Ubuntu hides some of the details to give the newcomer fewer hairy choices to make from the outset. In other words, an Arch installation will probably end up quite a bit more streamlined, but Ubuntu will cause less confusion for the non-specialist. So, using the Arch distribution to create a reduced-footprint desktop would certainly be not only a rational choice, but also one with which we would be able to go further up that road and really reduce disk space. But, from a personal point of view, I do think Ubuntu and its derivatives are better placed to help a “normal” user achieve a rational setup without too much hassle. I use the word rational as in functional (it must work), but also reasonably lightweight (it must weigh considerably less than a standard installation).
3
Choosing a desktop and an installation image It is no secret that among the different desktop choices available to Ubuntu users, some need more disk space than others. It will also come as no surprise that the more complete, but also slower, desktop interfaces are also those that take up more space. So Unity, Gnome and KDE are perhaps not the best suited for this particular task. Among the lighter desktop session managers, LXDE used by Lubuntu and XFCE used by Xubuntu are perhaps the two best-known. Choosing between them is largely a matter of personal opinion and taste, so if I will be using XFCE it is mainly because it is what I feel comfortable with both for speed and for its appearance. Your choice could very well be different, especially if more exotic desktops such as the Enlightenment (used by Bodhi Linux) or Razor-qt (a lightweight alternative based on the same Qt libraries as KDE) are thrown into the mix. However, to install these desktops, you will need to set up PPA repositories, so this would perhaps best be left for another occasion.
4
To get a minimized installation, two different approaches are possible: either we start out from a complete installation, and then remove what we do not want, or alternatively we can start out from a minimal installation and add just what we wish to use. With the apt package infrastructure that gives us the power to install or remove packages at will, both options should in theory be equivalent. However, in actual practice it is more convenient to choose the second route. This is why I will be starting out not with a desktop distribution image, but with a server image. This is a specialized distribution that starts out by installing a very basic system, on top of which we will add just the packages we need to set up the graphical desktop. Since I will be using this setup on several rather elderly low-powered laptops later on, I downloaded the i386 (32-bit) version of the server distribution for Trusty Tahr (14.04). Though it is perhaps not immediately obvious from Ubuntu's web page - that insists on offering the 64-bit version - the 549MB image for the i386 architecture can be downloaded from the following address: http://releases.ubuntu.com/14.04/ubuntu-14.04-server-i386.iso.
5
Installing the basic system Once we have the ISO image burned to a CD or installed on an USB thumb-drive, we can use it to boot up the target machine. The main difference from desktop Ubuntu images is that we have no Live CD option: we do not get to test the distribution directly, but must install it to hard drive first. The text-based installer (it actually uses the ncurses library) will get us through exactly the same stages as the better-known GUI installer. Using the manual tool, I simply created a single ext4 partition that used up the hard drive completely, though if in doubt the automatic partitioner should also make a good job of it. I am using a virtual machine and hard drive to prepare this, but, if using a physical computer, the usual caveats apply: make a backup of any data you want to conserve beforehand, because complete partitions (and the operating systems they contain) may get completely erased. At one point, the installation program will propose a choice of additional software packages. Most users will not need these, so we will leave them unchecked. They can always be installed later on if needed. Once the system is installed, we can reboot from the hard drive and login at the prompt. We will have access to only a text-based interface for the time being, until we install the graphical interface. With the df and free commands, we can see how this type of interface uses up very little disk space and memory. On my test system, the installed server system was using a mere 942MB of disk and 98MB of RAM:
6
Installing XFCE The first thing we will need to do is make ourselves administrator (super-user). We can either use the sudo command before each succeeding step, or use it just once to create a new shell as admin: $ sudo bash # Note the change of prompt, going from '$' to '#'. Before installing anything, we need to refresh the list of software packages from the Ubuntu repositories. Setting up a WiFi connection from the command line is slightly involved, so just connecting our machine with a physical (Ethernet) cable will be much easier. Once connected, we will allow the system several seconds to set up the network interface automatically, and then type: # aptitude update You should see the system connect to the repositories, and download a list of the most recent versions of each package. We can proceed by installing both the X-Window server (graphical subsystem) and the XFCE desktop at the same time. Use: # aptitude install xfce4-session pulseaudio xinit x11-session-utils
7
We should be requested confirmation to download some 59.7MB of data, which is then unpacked and set up. When the process has finished, the df command should report about 1.2GB of disk space used. We are at the end of the first step. At this point we should have the desktop session installed, that we can execute manually using the startx command. This is a minimal XFCE desktop, with no panel (and no applications) for the time being. We should complete the installation with the XFCE panel, an icon set, and at the very least a terminal. This will take a download of just 6MB between them: # aptitude install xfce4-panel xubuntu-icon-theme xfce4-terminal We have completed the second step. We have a minimal XFCE desktop working, though it still needs to be started up with the startx command. We may need to start the panel manually the first time we use it; to do so, start up a terminal within XFCE, and type $ xfce4-panel &
8
Installing a display manager Moving forward, most users would like the graphical desktop to come up automatically at boot, without having to use the startx command manually each time. A simple solution would be to write the appropriate script, but this would be a departure from the standard Ubuntu configuration. In the interest of ease of maintenance, we will install a display manager instead. The display manager is a type of program that offers us the typical login screen of desktop installations. It has two main functions: on the one hand performing authentication and allowing access to the user's desktop, and on the other giving the user a choice of desktop session and session language. However, most personal computers are typically used by a single person, who uses the default system language and does not often change the desktop session manager. If this is your case, it may make sense to prefer the nodm package over any of the standard options. This package starts up the desktop session directly, without presenting a login screen. A look at the various options shows us that this is the least costly choice in terms of download size, even better than the already lightweight XFCE display manager, xdm: lightdm: 192 MB kdm: 103 MB gdm: 81.8 MB xdm: 172 kB nodm: 32 kB
9
We use the standard procedure to download nodm: # aptitude install nodm We also need to edit configuration file /etc/default/nodm, replacing line NODM_ENABLED=false with NODM_ENABLED=true In the same file, modify line NODM_USER=root with whatever user login you prefer. This is the end of the third step: we have a minimal Xfce4 desktop that launches at boot. Note that when the user logs out, the X session reboots and the user is directly logged in once more. This behavior is probably not what the more security-conscious would recommend, but may be acceptable for machines that are always physically secure.
10
Finishing up We will probably need at least a web navigator to make effective use of this system. Installing the Firefox navigator is a simple way of transforming it into both a web access station, and a general-use office machine based on web services. An equivalent of a Chromebook, so to speak, but on your own hardware. This navigator takes a 30.7MB download: # aptitude install firefox Just to clean things up, we can remove the memtest package that is rarely used on a stable system, as well as the aptitude cache of downloaded software: # aptitude remove memtest86+ # aptitude clean By this point, disk occupation has gone up a little, to about 1.4GB. This is still less than half that of a standard Ubuntu installation - so we seem to have achieved our aim. Under these conditions, RAM usage can go down as far a 172MB with the graphical desktop in use. It will increase, however, as soon as we start browsing the web or using other programs. Once Javascript and Flash are in action, there is not much difference in terms of RAM usage between lightweight and standard installation, though some savings can be made and may be worth it on a lightweight computer.