Table of Contents

How Linux software installation works

Most Linuxes use packages to install files. These are effectively bundles of files in one large archive file. Different flavours of Linux have different packages, with different extensions- the EEE's default distribution, Xandros, uses the same package format as its parent distribution, Debian. As a result, these packages have the file extension .deb which is why people call them 'deb files'.

Some packages contain entire applications, while others contain support files (aka library files under Windows). Every piece of software on the Eee came from a package, even the central kernel program, and most Linux installers do little more than partition the hard disk and then unpackage lots of packages. Some packages also include configuration scripts so that the software works correctly once installed (or so it works with the rest of the system).

I said above that some packages contain nothing but library files and this leads us to perhaps the biggest difference between Linux and Windows. On Windows, the necessary library files are supplied with each program you download and install. The program installation .exe comes complete with everything you need. This causes problems because sometimes more than one copy of a particular library ends up on the system, causing crashes. It also means that the installation files are fat.

Under Linux, the package for the program you're interested in only contains the actual program itself. Any library files it needs must be supplied separately, courtesy of other packages. This is why it's unusual to download a single package installation file when running Linux, and it's why elaborate systems are in place to aid software installation. These systems help take care of the library files by ensuring they're downloaded and/or installed at the same time (presuming, of course, that they're not already present on the system, as they often are).

This system is called (for obvious reasons) dependency management. The whole system of package installation is usually called package management.

Eee Linux is based on Xandros, which is in turn based on Debian, which uses dpkg package management. However, the two tools you're most likely to use are apt (at the command line), and Synaptic, which is a GUI app. Synaptic is literally a front-end for the apt commands – whenever you click to install a program, it literally just enters the relevant apt commands on your behalf in the background. Incidentally, dpkg/apt is one of the best package management systems there is, and was also the first. It's a work of art.

So let's sum up at this point. Synaptic can be used to install programs. It's useful in that it will take care of dependencies for you too – it will also download and install any library files you need for the software you want to install, automatically (although it will ask for your confirmation).

For this to work, Synaptic accesses what are called repositories. These are just large cataloged download sites full of programs (although repositories can also exist on CDs/DVDs – the installation CD/DVD for a Linux distro is effectively a large package repository).

And thats how you install software. You look up the software you want in the repository, using Synaptic, and then choose to install it. Synaptic takes care of it all for you, downloading not only the software from the repository but also any library files (dependencies) that it needs. Synaptic also might have to remove some incompatible software too, in order to install your software, and it will also do this too. It's clever, but you should keep an eye on what it wants to do whenever you use it.

As you might have guessed, a package management system makes it easy to update a system too. Once updated software is added to the repository, it can all be automatically downloaded to your system (and the old version removed) by Synaptic or apt.

Some package repositories are setup by default on the Eee but these only contain the packages in the basic install of Eee Linux. So it pays to add the Xandros repositories and even the Debian ones, because these contain other software, such as The Gimp photo editor, which isn't available in the Asus Eee repository (at least not yet). Adding new repositories (which look like long web addresses) is done by either editing the /etc/apt/sources.list file, or using the relevant entry on the Tools menu of Synaptic.

Repositories for a particular distro will usually contain all the software you need or have heard of. Unlike with Windows, you haven't got to go to the 'official website' to get software (winzip from www.winzip.com for example). The Debian repositories contain virtually all the open source (GPL) software there is. This is possible because open source software is designed to be shared, rather than hoarded and tightly controlled by an individual or company.

So, in summary, software installation on the Eee is handled by Synaptic or apt. You can run Synaptic by opening a terminal window (ctrl+alt+t in simple desktop) and typing sudo synaptic. Then choose the new apps you want, and click the Apply button. Everything else happens automagically.

One last word. It is possible to simply download and install packages manually (which is to say, download .deb files you find on a website, for example). But you'll have to take care of dependency management manually, which can be a nightmare (a situation known as dependency hell). If you do take this route then it pays to download a package specifically created for your version of Linux , because it's tailored for your system, and in our case that's Xandros (or, at a push, Debian Etch). You can also download tarballs of binary files, or even source code, and compile it yourself. But that's a whole level of complexity that's negated by the proper use of Synaptic.

Incidentally, Synaptic is a bit flaky on the Eee at the time of writing. It has a habit of reporting an error rather than actually installing. Sometimes it's just a matter of trying and trying again. The only reliable way to install/remove software is to use the apt-get command.

A worked example of software installation: ScummVM

Niel1952 wrote:

I would quite like to install ScummVM. I read that this is in the Debian repositories.

OK, so let's use this as an example to further work through the concepts of package management.

  1. You'll have to add the Debian Etch repositories to your Eee. This is described elsewhere on this wiki. What you're doing is letting your Eee know about several new, larger repositories of software. Technically speaking these are for a different distro – Debian Etch – but Eee Linux is based on Debian, so the repositories are similar enough for it to work. Just about.
  2. However, you need to tell your Eee to prefer packages from the main Asus repositories, because the Debian contains a lot of the same packages and, given the chance, the package management system will upgrade to these other packages if they're newer. Because the packages might be different, such an upgrade could break things. Avoiding this is done by something called pinning, and it's described in the latter half of the wiki page describing adding Xandros repositories. Note that pinning wouldn't be required if you were adding repositories specifically built for the Eee. Outside of the official Asus repositories there aren't any of these right now, but this might change as time goes on. This is the kind of thing that the community is good at (another difference between Linux and Windows – with Linux, people tend to take care of things themselves, rather than expect a company to do it for them).
  3. Debian repositories are usually split into a variety of categories, but the key ones are free and non-free. This means programs that are open source (free) or not open source (non-free) – technically we mean GPL or not GPL, but that's not important right now. I suspect scummvm will be in free, but the games will be in non-free. So ensure you add both of them.
  4. So with the Debian repositories added, and your Eee told to add packages only if they aren't available in the main Asus repositories (pinning), we can look for the scummvm. So open a terminal window (ctrl+alt+t) and fire up Synaptic by typing sudo syanptic. The sudo part tells the Eee to run Synaptic as root (administrator), and this is necessary because software installation can't be done by an ordinary user account. You need to briefly borrow administrator powers.
  5. Synaptic is pretty simple and you can click the Search button to look for scummvm. While there you can also search for Flight of the Amazon Queen and Beneath a Steel Sky, using the package names specified on the page you read.
  6. Once done, click to install. You may or may not have to install other packages that contain library files needed by scumvv. If so, these should be automatically selected. You'll just have confirm the choices. Once that's done, you can go ahead and download/install the software.
  7. Some software adds an icon to the kicker menu but this isn't guaranteed. If not, you might have to start the program manually from the terminal each time you want to use it (or add your own icon to the kicker menu, which you can figure out at your leisure). Of course, you'll need to know the program's filename to start it, but this is usually common sense. With scummvm, you can probably just type scummvm. A good tip is to type the first few letters (scu) and then hit tab. The terminal will then autocomplete the rest, or at least present you with a set of possibilities. The terminal 'knows about' all the programs that are installed, in that it has a little database of their filenames.

Typical apt commands for use at the command line

As mentioned above, Synaptic should be used for software installation and removal. However, you can also use the apt commands from the command-line. Indeed, this might be necessary considering that (at the time of writing) Synaptic has a bug that means it's useless.

So here are the most commonly used apt commands. Note that these should be run with administrator privileges, which means preceding them with sudo, or typing sudo su before typing any apt commands. You can open a terminal window in simple desktop mode by typing Ctrl+Alt+t. When you've finished installing, type exit to return to your ordinary user login.

apt-get update - This will update your computer's list of the software available in the repositories. It should be run before you install software because repositories are updated frequently.

apt-cache search packagename - Search the repositories for packagename. Both the names and descriptions of packages are searched. If you were searching for a calculator application, you could type apt-cache search calculator. The result might look something like this:

kcalc - a calculator for the KDE desktop

… in which case you should make an exact note of the program name – the first part of the line.

apt-get install packagename - Install packagename. Continuing our example above, to install kcalc we'd type apt-get install kcalc. Bear in mind that apt will check for any dependencies, and add them to the list if they aren't already installed. If might also want to remove some incompatible software, such as an older version. If this happens you'll be asked to confirm what apt wants to do. Have a good read and never assume apt knows what's best. It's just a computer program.

apt-get remove packagename - Uninstall packagename. The same caveats as above apply – check what apt suggests before blindly typing Y to agree to it.

apt-get clean - Cleanup downloaded package cache. This is usually a good idea to save disk space.