Flipping the Linux switch: Package management 101
Your 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.













Comments
36
Subscribe to commentsgrey geekJan 24th 2008 4:14AM
I've stopped using any MS software back in 1997 and I do not regret it. I do work for a big semiconductor company in Silicon Valley, CA. All my work is done on UNIX/LINUX/Solaris including design, documentation and presentation. Yes I do watch encrypted and not encrypted DVDs, edit videos, listen audio, run Skype video phone etc etc on Linux without a problem.
But, I have to admit one thing, I do not have a clue how to fight viruses, worms, spyware, anoyware. And I do not regret it.
JasonJan 8th 2008 9:22AM
This article is a great example why Linux will just never become main stream...
wesleyJan 8th 2008 9:39AM
Why is that? Because Linux offers choice? Or because Linux has great systems for installing software that's much easier to use than Windows?
Let us know why you think this means Linux won't be mainstream. Just saying that and not giving any reasons is just asking to start a flame war.
JasonJan 8th 2008 9:46AM
Did you read the article? Choice is only good when its informed choice... The average user has no clue what any of this stuff is and articles like this don't make it sound less complicated or easier to deal with...
I don't hate Linux or anything like that but its designed by "geeks" for "geeks"... OSX is a perfect example of how to do Linux right... most people don't know OSX is Linux... you need to have a single "front" for the OS... not an infinate number of choices that are hard to understand.
JoeJan 8th 2008 11:21AM
"most people don't know OSX is Linux"
Most people know that Mac OS X is not Linux.
The kernel, XNU, is a hybrid of Mach and BSD.
Although their bases are similar, Mac OS X and linux are not the same thing. "Don't compare apples to penguins." (TM)
You also can't make a certain GUI [or any other program for that matter] standard for Linux, because Linux is just a kernel. And having a standard Linux distribution would be impossible.
"Old McDonald bought the farm, E-I-E-I-O!"
and then he kicked the bucket, bit the dust,...
Frank ZhaoJan 9th 2008 2:29AM
You click on Synaptic, search for the name of the program you need, check mark it, it'll then automatically find everything else you need, click apply and you are done, whats so hard about that?
I love that I don't need to agree to any agreements every single freaking time I install something.
SeanJan 9th 2008 8:43AM
Quote: "This article is a great example why Linux will just never become main stream..."
.....uhhh, is that because most people are too flipping lazy to really learn how to use the tools that they're working with?
That's why God made Sysadmins. It was in the bylines after the 3rd day.
=8^P>
EricJan 9th 2008 3:29PM
I work with Windows users constantly. Except for advanced Windows users (who wouldn't have a problem understanding how this works in Linux) not a single Windows user understands how installations work in Windows.
A long time ago I stopped trying to explain the registry (an abomination not matter how you look at it) and anything else related to directories, caches, file extensions, etc...
I would never recommend to a user to try all the distros that are out there. I point them to Ubuntu because of it's support and popularity on the net. When they're ready, I'm certain they'll look at other distros - especially the advanced users.
Jimmy the chipJan 8th 2008 10:31AM
Jason, firstly, OSX isn't Linux. It is based on UNIX wich I think is what you mean.
In terms of a single "front" as you put it, there are distributions of linux which has something along these lines (try SUSE if you are interested).
And as an Ubuntu user, I can tell you that the process of finding a piece of software that does something I need is much easier than on XP or Vista. For example, in synaptic, if I want to install an internet browser, you can just search for "internet browser" in synaptic, select it and click go.
The only reason that one might think this system is more complicated is if they are much more familiar with the windows software installation model in the first place (which, lets face it, most people are). If someone had been using apt-get or synaptic all their life, wanted a nice new chess game on their new XP machine, the idea of researching, googling and ultimately installing a peice of software developed by a company you have never heard of who are unwilling to show you exactly what their software might do once you have installed it would seem extremely odd, I suspect.
Kristin ShoemakerJan 8th 2008 10:39AM
Good point, Jimmy, and it's the reason why I mentioned what you see when you go to the site of an individual program, and moved on to package installers and their graphical front ends. Most people coming from Windows to Linux think in terms of, "I need X program, let me go download it." And they're hopelessly confused by what they see.
With package managers, it isn't necessary. Just open your chosen distro's installer program, and type what you're looking for.
It does all the hard work.
ellspyFeb 21st 2008 10:54AM
As of OS X 10.5 Leopard it is now UNIX. It is no longer based on UNIX but actually is UNIX.
Just thought it would be good to inform future readers.
Richard ChapmanJan 8th 2008 2:10PM
People like Jason confuse familiar with easy-to-use. If he's happy with the choices Steve Jobs made for him, then great. But it's rude to suggest that the Steve Jobs choice is the right choice for everyone. As far as I can see, the only choice in operating systems that's right for everyone is the one that gives multiple choices.
Jimmy the chipJan 8th 2008 7:08PM
I agree to an extent. But it is impossible to deny that in any situation, too much choice is overwhelming. Mac OS' specifically (but also windows') have 'killer apps' that are quite clearly the best, or if not, the best any 'non-geek' is going to find. Knowing what packages you want is somewhat harder when faced with, e.g., a text list of 20 remote desktop programs that synaptic might throw at you.
Swings and roundabouts, perhaps, but if you are trying to steal the market as some linux disto's attempt to, an initial reaction of "how do I choose" is never going to be a good starter. Before ubuntu was the immediate choice for most newbies, even choosing a distro was a difficult enough decision. That is where I lean towards Jason's 'by geeks for geeks' direction. It is the geeks who can be bothered to invest the time most wont. As someone who is not in an IT proffesion, I sometimes wonder if the time spent becoming familiar with linux is overall productive. I think maybe not.
But now I am here, I would never go back :P
JasonJan 9th 2008 8:33AM
No... I think you have mistaken familiar (to you) with ease-of-use... Sure... if you know alot about routing and TCPIP then installing networks is easy... because its familiar... I am talking about ease-of-use to the end user... someone who doesn't know anything about computers...
I put Ubuntu on a PC for my mother in-law and she HATES it... Asks me everyday to put Windows back on it... Probably would if she wasn't my mother in-law ;)
mikeJan 8th 2008 7:02PM
For finding 90% of apps linux is easier, if not familiar. But once you want to find something not in the default repo, its much more difficult. There is no simple, universal equivalent to a .exe installer in linux. This is really something that once solved will put linux over the edge.
RumbleJan 8th 2008 8:21PM
Frozen Bubble, heck yeah!
Kristin ShoemakerJan 8th 2008 8:28PM
So addictive... must... stop.... playing....
BrandenJan 9th 2008 3:27AM
I'd like to see Linux become more user friendly.
When I first started playing with SUSE about a year and a half ago I didn't have the slightest clue about packages. I soon learned the difference between tar's and rpms etc and repositories & dependencies. Quite frankly for an average user I can see how these things get overwhelming and can cause confusion to the average joe smoe.
So I'd have to agree that linux, as of now, is still a geeks playground. I like having access to my consoles whenever I need them but the average user isn't going to even know how to user anything other then a familiar GUI.
With that being said I love linux but I'vebeen stuck in Server 03 lately trying to get my MCSA. Soon I'll return to my precious linux client, soon.
MyztryJan 9th 2008 3:53AM
Linux Package Management is great. It's akin to having Windows Update for your Operating System, except it covers essentially every program available.
Sure the choice can be overwhelming but it is a simple matter of searching the repository for what you are looking for. Windows programs don't just materialize. They need to be searched for.
Anyone can place a Windows executable file online, but not just anyone can enter a package into the distribution repositories.
I would much search a repository and tick a box then download a file merely called "setup.exe" and hope I'm not being set up by some Malware author!
JerryJan 9th 2008 5:32AM
I don't see much difference between the different between rpm and deb, the only thing I want is something like the .exe in windows where you have one package to install, and will all the dependencies included.