Chapter 3: Package Management

  • strict warning: Non-static method view::load() should not be called statically in /home1/thephan1/public_html/sites/all/modules/views/views.module on line 879.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home1/thephan1/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 589.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home1/thephan1/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 589.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home1/thephan1/public_html/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 149.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home1/thephan1/public_html/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home1/thephan1/public_html/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.

One of the biggest issues when it comes to working with Linux is the installation of programs. Back in the old days, when Linux was primarily for the geeks, installing a program generally involved getting the source code and compiling it yourself. If you were really lucky, you, or somebody else, had written some sort of shell script (a basic set of commands) that would do all the hard work for you. However, nowadays the installation of programs has shifted over to tools called Package Managers.

Package managers are one of Linux's most powerful features. Since they're an integrated part of the operating system, they make the installation and maintenance of programs a lot easier and more streamlined. Compared to the typical installation of software through Windows at the moment, this method is a lot cleaner and results in a stabler environment.



A Brief Summary of Installers
Generally, the installation of software on Windows is handled by an installer. The installer comes with the software, and when it is run it will copy all the necessary files to their appropriate locations, configure the proper OS settings, and (hopefully) set the system up so it can easily remove (uninstall) the software when the user is finished with it.

However, sometimes an installer may make unwanted changes to the user's OS. It may also leave parts of the software hanging around even after uninstallation. And because there are many different types of installers out there, they each work differently, meaning you'd have to know the foibles of each to compensate for the issues they may cause on your system.

In short, while installers are pretty handy (you run it, you say "next" a lot, and then it's done) they do take control away from your system.



How A Package Manager Does It
Package managers are actually part of the operating system. This means that the OS can limit them and control them as per the user's choice. Also, since they have a unified way of working within the OS, the OS can maintain a lot tighter control when installing software, giving a more unified front. For example, most package managers have a database of the installed software, from which the user can keep track of everything installed. Also, since the package manager does all the work of pointing where the data should go and how it should behave, all that needs to be provided is the raw data.

Adept Screenshot
The Adept package manager for Kubuntu.

Most of this data can be found in a repository. A repository is basically a large, online database of all the software available for the package manager to use. The user can simply search through this repository to find the software they want, point the package manager to it, and then watch as the software installs. And then, when they're done, they just tell the package manager to remove it and all traces of that software will disappear from the system. Also, additional repositories can be added to the package manager's list, adding additional packages for the user to download.

Another nice thing about a package management system is that since everything installed on your system is tracked by the database, software can be broken down into its components. For example, in order for a program to work, it may need an additional library. So you install that library along with the program. Now, if another program you install in the future also needs to use that library, it won't need to install its own copy. It can just reference the one that's already installed. While some of this is done in Windows already (say, for example, with DirectX and most games) with a centralized database of a package manager, software can be broken into further chunks.

Let's look at an example of all of this in action. Here's how a package manager would work:

  • The user decides that he wants to play the game "Crazy Penguins." So he runs his package manager, searches the repository, and selects "Crazy Penguins" for installation.
  • The package manager shows the user that in order to install "Crazy Penguins," some other "dependent" packages need to be on his system as well. These include "libSDL" (as the game uses SDL for retrieving keyboard input and so forth), "libOgg" (since the sound effects are stored in .ogg format), and "Crazy Penguins - Data" (which has the levels, sprites, sounds, and all the data for the program).
  • Fortunately for the user, "libSDL" is already on his system from a previous game, so he doesn't need to install it. The user also decides to install the optional "Crazy Penguins - Banana Data" package instead of the regular data package. This package replaces all of the graphics with pictures of bananas and the sounds with the "bananaphone" song. Cool! Everything else is installed normally.
  • After a few minutes, installation is complete and the user can enjoy his game. However, after 5 minutes of play, he decides that it's boring, so he uses the package manager to remove the game. Since no other programs are using the "libOgg" and "Crazy Penguins - Banana Data" packages, these are automatically removed as well. ("libSDL" will stay installed, since there are other games on the system that still need to use it.)
  • And that's how it works! There may be some differences between the different types of package managers, but on the whole, most work like that. Next we'll take a look at the most popular package managers at the moment.

    For more information on package managers in general, we turn to Wikipedia.



    APT
    APT stands for "Advanced Packaging Tool," and is one of the most powerful package managers available. APT is used to install .deb packages, which is the primary package type for Debian-based distributions of Linux. APT is quite popular because it's very good at detecting dependent packages. It also updates any packages to their latest versions very easily. In fact, it's very simple to have APT search for all the latest packages and then upgrade all the packages you have installed to be up to date.

    Synaptic Screenshot
    The Synaptic package manager for Ubuntu.

    More info can be found on Wikipedia.



    RPM Package Manager
    The RPM package manager was one of the first package managers available for Linux. As a result, it's quite popular and can be found in many distributions, such as Red Hat, Suse, and Mandriva Linux. Also, there are many, MANY packages available due to it's popularity. However, it does have a few dependency issues, making it a bit less easy to use in comparison to APT. Despite this, the RPM is constantly improving, so hopefully these issues will be fixed in future versions.

    More info can be found on Wikipedia.



    Slackware Package Management
    Slackware is known for its minimalist approach to package management. Packages come in .tgz format, which is essentially the Linux version of a .zip file. (Well, not quite, but pretty close.) Installing is relatively simple, but slightly more involved than other package managers, mainly because it doesn't track dependencies. You have to do this yourself. On the bright side, you have a lot more control over what is installed on your system. It isn't as common as some of the other package managers, but it is used in several distributions. I don't recommend this for beginners, but some advanced users may find it preferable.

    More info can be found in Wikipedia's Slackware article.



    Portage
    Portage is the Gentoo package manager. This one is a bit different from the other package managers in that it downloads the packages as source code and makefiles, then compiles them on your computer. This means that you get a LOT of control over how software is set up on your system, as you can specify the details of the software's compilation. It's a bit more complicated and involved than the other package managers, and I don't recommend it for beginners (or most experts for that matter.) Well, perhaps I exaggerate. Using Portage isn't as difficult as it sounds, though it does take some getting used to.

    More info can be found on Wikipedia.

    I encounter a lot of new Linux users asking "How do I install new software?" quite often, and although using a package manager may seem a bit confusing at first, once you get used to it you'll find it's a better solution to software installation than using stand-alone installers.

    Next Up:
    What is a file system and what kinds are there?