Ceci est une ancienne révision du document !
Hi, everyone! Welcome back to Ask the New Guy!
Today’s question comes to us from Joe P. who asks:
Q: How do I update programs in Ubuntu?
A: Good question, Joe!
Any thorough discussion of this topic begins, as it should, with the final scene in Chinatown.
Jake Gittes spends the entire movie trying to figure out how the world works – only to meet with misery. While trying to give Gittes some perspective on his woes, his partner Walsh delivers one of the most famous lines in movie history:
“Forget it, Jake, it's Chinatown.”
That's how I feel about software updates.
“Forget it, Copil, it's package management.”
Sure, it doesn't have the same dramatic oomph, but you get the idea. A process that should be straightforward is LITERALLY like skiing through a revolving door. It can't be done! It's simply impossible to understand, Joe, and you shouldn't even try. Do what I do. Throw your hands in the air and put on an episode of Here Comes Honey Boo-Boo. You'll feel better, trust me.
I mean, if it's really important to you, I guess you could simply burn a new .iso, and re-install Ubuntu every time you need to update some minor solitaire game. Easy peasy, lemon squeezy.
Oh, fine, Joe, if you're going to be such a defeatist, and say my solution seems unreasonable, then I'm forced to take you through the ugly process so you can see for yourself.
I warned you, Joe, you're playing with fire, you're walking into the mouth of madness, you're buying discount condoms at the Dollar Store. This won't be pretty.
WHAT'S A PACKAGE?
Let's start by defining terms. For some insane reason, Ubuntu refers to programs as packages. Leave it to the evil cabal behind Linux to rename everything. I mean, do these people go around calling their ears “hearing eyes?” Well, they shouldn't.
Hey, I just looked this up and it turns out Linux talks about packages because, when you want to install a program, there are usually a bunch of files and programs that are necessary to make it run.
So, why aren't those files already included in a typical Ubuntu install? Because if you included the universe of programs and files needed to make ALL software run (even stuff you'll never, ever use), Ubuntu would be as bloated as my Aunt Gertrude after burrito night at her Canasta club.
Instead, Linux programs are “packaged” with all the bits you need to run them. If homebuilt guillotine kits worked this way, you'd get a free Front-of-the-Line pass for the emergency room. So I guess this is kinda smart if you think about it. Probably just an anomaly, though. Don't worry, Joe, the rest of this will be unintelligible, I promise.
ADD PACKAGES USING UBUNTU SOFTWARE CENTER
Okay, so let's look at adding a package (then we'll move on to updating it). First, find the Ubuntu Software Center. In Ubuntu 12.04 you can type Software in the Dash field.
Type the name or description of what you're looking for (eg: text editor) in the top-right search field. Choose the software you want from the results, and click INSTALL. Once you give it your root password, the program installs.
Hmm, I must be doing something wrong because that was completely painless. And it even downloaded all the extra bits I needed to run the program without me lifting a finger.
Well, the fun ends here because keeping that bad boy up-to-date is like wearing sandpaper contact lenses (which I used to do until they upgraded my health plan at work).
UPDATE PACKAGES USING UPDATE MANAGER
See, packages added from the Software Center get updated using the Update Manager.
The Update Manager alerts you when there are updates for your installed packages. To apply the changes, you click the INSTALL UPDATES button. I mean, c'mon, what am I, a brain surgeon?!
Again, there must be a step missing because that wasn't so bad.
Well, it’s all uphill from here because it's time to try doing this stuff at the command line. Hide the children and the elderly, it’s about to go Human Centipede up in this hizzy.
STEP 1: UPDATE THE PACKAGE INDEX
So get this. Before you go installing programs, Linux suggests you update something called the Package Index. Da Hell?!
Well, we know what packages are. But an index of packages is probably some kind of compendium of cray-cray. Right?
Wait. No, I just checked and it's just an index. Of packages. My bad.
So the Package Index simply lists all the packages I can choose from? When you put it that way, I guess it makes sense to update it from time to time so I have the most current list of packages.
Fine, here's what you type:
sudo apt-get update
Sudo gives you root access, apt-get is the command that installs/updates packages, and update tells the apt-get tool to update the Package Index.
Now that we have a current list of available programs, our luck has come to an end. It's time to install a package.
STEP 2: INSTALL A PACKAGE
Let's say you want to install a program called ProgramName (original, huh?). Take a look at this horrible stew of rancid commands:
sudo apt-get install ProgramName
Wait. . .this just seemed so complicated in my mind, you know?
STEP 3: UPDATE THE PACKAGE
The only thing left to do now is update the program you just installed. Leave it to Linux to give us, like, a bajillion ways to do it. I picked one at random, and you won’t believe how complicated it is. Have a hankie ready in case your eyes bleed:
sudo apt-get install ProgramName
That's the command line entry for INSTALLING a package! Do you think I’m stupid, Ubuntu?!
Ah, I see now. Running this command when the program is already installed causes Linux to update the package to the latest version. Even I have to admit, that’s pretty cool!
No, NO! FOCUS! This is NOT easy, don't get distracted by Ubuntu's shiny ways and charming demeanor. It will kill you in your sleep!
Here’s a scenario Ubuntu can’t fake its way out of. Let's say you installed a package a while back. But you forgot its name. All you remember is that you wanted to update to the newest version. I DON'T KNOW, maybe someone hit you on the head with a cricket bat and you got selective amnesia! Work with me, people!
In this completely plausible scenario, here's what you type:
sudo apt-get upgrade
Wait, what? And you say it also upgrades ALL YOUR PACKAGES, not just the one you couldn’t remember? Oh.
Let's recap.
Packages are programs plus all the bits you need to run them.
To Install/Update Packages using a Mouse: 1. Find and install the packages you want from the Ubuntu Software Center 2. Update all installed packages using Update Manager
To Install/Update Packages using the Command Line: 1. Update the list of packages: sudo apt-get update 2. Install the desired program (or update it if it's already installed): sudo apt-get install ProgramName 3. Upgrade all installed packages to latest versions: sudo apt-get upgrade
Whoa. That all looks pretty easy! But I thought Linux was HARD! Are you as confused as I am?
Forget it, Joe, it's Ubuntu.
Thanks to Joe P. for his question! f you have a simple question and want an answer that doesn’t require grad school, contact me at copil.yanez@gmail.com.