Skip to Content

New to the Mac? Check out TUAW's Mac 101
AOL Tech

Filed under: OS Updates, Features, Linux, Open Source, How-Tos

Flipping the Linux switch: Package management 101

Synaptic Package ManagerYour shiny new Linux system has it all -- except that one program you really needed it to install. You get online, you find the program's website, and click 'download'. Except there's not just a link to the program there.

There are four, or five, or more links to the program. Each has a slightly different format, ending with .rpm, .deb, .tgz, or possibly even .ebuild.

Some include x86 in the name, while others say ppc or amd64. What's the difference? What's actually included in these packages?

Packages are pre-compiled programs for your system (the exception being Gentoo's .ebuild). You've got to know a bit about your system to install them.


It's not enough to know just that you need an .rpm or .deb. You should know your computer's architecture (32 or 64 bit chip? PowerPC?), as well as the architecture of the distribution you installed. Don't panic if you have a 64 bit chip and installed an x86 distribution (backwards compatibility is a good thing), but keep in mind you'll have to install x86 packages. It's best to use a package labeled for your distribution, though in some cases it is possible to install packages across similar Linux systems. For instance, many Slackware packages are able to install on Zenwalk.

Package management refers to the way your distribution installs and configures (as well as manages and removes) software applications and libraries on your system. When Windows installs an .exe (which is the closest thing in Windows to a package) it usually places it in a single specific place within a directory. Linux installs across a few directories, leaving many new Linux users scratching their heads as to where their .rpm actually went. Most distributions install the executables in /usr/bin, and the libraries in /usr/lib. You may notice related files in /usr/share or /etc.

Fear not, brave user. Package management systems have front-ends that make installing and removing packages easy. For instance, dpkg installs .deb files, and apt (or a graphical installer front-end to apt like Synaptic) can be used to not only install the program in question, but any underlying programs it might require to run (called dependencies). For .rpm files there is YUM, with graphical front-ends like Pirut or KYum. Slackware has swaret that uses the installpkg command set. Gentoo has portage and the emerge command. All of the aforementioned front-ends handle dependencies, which can save you loads of frustration (and keep you from descending into dependency hell).

Package management systems call upon your distribution's software repositories to add programs, as well as keep track of anything you have installed. This is how it can calculate dependencies and hopefully help resolve them. If the dependency can't be resolved (if two programs require dependencies that can't co-exist on a system, for instance), the front-end will inform you of this so you can decide what to do.

So what about installing that critical missing piece of software? Let's take a look at the process using Synaptic. YUM front ends work similarly. Slackware's swaret and Gentoo's portage are command-line based, but commands and configuration are well documented.

Upon opening Synaptic (or any application that installs programs) you are asked for the root password (in Ubuntu, this is your user password, as Ubuntu handles the root account differently). We need not remind you that root powers are not to be used lightly, and to only add trusted sources to your repositories.

When Synaptic opens, you can use filters to explore various packages on the system, including upgraded packages and installed packages. Here we see all available packages.



We press the reload button, so that the latest changes to the repository are registered. Then we search for the package we are so sorely lacking.



We select the package for installation. This is where the magic happens. Our system is scrutinized by apt, and Synaptic tells us that we don't have a lot of the dependencies we need. Since we really need this program, and there are no conflicts, we tell Synaptic to apply the changes.




Synaptic begins downloading from the available repositories. Once it's done downloading, the install process begins. In this case, the downloading took about four minutes, and the install took less than eight seconds. Here we can see the completed install process with a little feedback from apt about what it's doing.



And we're in business with our newly installed (and extremely critical) application.



Package management systems are often a source of confusion for new Linux users, but they're essential to keeping your system up to date and working the way you want. Fortunately, through the use of front-ends and installers, it's easy to build a system that's lean and fast, performs a specific task, or simply takes care of itself.

Reader Comments (Page 1 of 2)

Featured Time Waster

Civiballs is a beautiful, soothing physics puzzle Time Waster

CiviballsI have an absolute weakness for physics games, and while Civiballs isn't the strongest physics-based game, what it lacks in the physics department it makes up for a few times over in style and fun.

In Civiballs, you are presented with a few colored balls, and your goal is to get those balls into the same-colored urn on the level. The "civi" part of Civiballs is that there are 3 sets of levels to play, each representing a different civilization. While the civilization doesn't affect gameplay, the artwork for each level is beautifully themed to it's appropriate era.

To play the game, you are given only one tool - a sword with which to cut the chains that are holding the balls. The puzzle part of the game is in figuring out what order, and with what timing to cut each chain. Do it right, and all the right balls end up in the right urns, with no stray balls entering an urn (a no-no). Do it wrong, and you get to start over again.

Civiballs is not terribly deep on gameplay; the entire game can be completed in about 15 minutes. But if you enjoy this type of game, it will be a very enjoyable 15 minutes.

View more Time Wasters

Featured Galleries

Defective by Design, London: Protest Pictures
Microsoft Security Essentials
Chromium Pre-Alpha on CrunchBang Linux
Safari 4 Beta
10 Firefox themes that don't suck
IE8 RC1
Download Squad at the Crunchies After-Party
Download Squad at the Crunchies
WordPress 2.7
Cooking Mama: Mama Kills Animals
Windows 7 Hands On
Comodo Internet Security
Android First-look: Amazon.com MP3 Store
Android First-look: Twitroid
Google Reader Android
Android Hands-On
Twine 1.0
Photoshop Express Beta
Mozilla Birthday Cake
Palm stuff
Adobe Lightroom 1.1

 


Follow us on Twitter!

Flickr Pool

www.flickr.com

Download Squad bloggers (30 days)

#BloggerPostsCmts
1Lee Mathews8080
2Jay Hathaway681
3Brad Linder684
4Jason Clarke312
5Grant Robertson912
6Christina Warren29
7Nik Fletcher20

More Tech Coverage

AOL Radio