Upgrading & Updating Your Computer

with Debian’s APT

R. Scott Granneman

scott@granneman.com

www.granneman.com

© 2004 Scott Granneman

Last updated 20040331

You are free to use this work, with certain restrictions.

For full licensing information, please see the last slide/page.

Microsoft Windows has Windows Update.

Windows Update pro’s:

Automatic (although this can also be a con)

Easy to use (unless it doesn't work right)

Windows Update con’s:

Sometimes forces you to accept onerous licensing terms in order to get an important fix

Sometimes labels things as important fixes which aren’t

You have no idea what files are being updated, changed, & installed on your computer

Only updates MSFT's software and a few

drivers

Almost always requires a reboot

Apple Mac OS X has Auto Update.

Auto Update pro’s:

Automatic

Easy to use

Auto Update con’s:

Often requires a reboot

You have no idea what files are being updated,

changed, or installed on your computer

Only updates Apple's software

Linux, of course, gives you several options.

Ximian Red Carpet

http://www.ximian.com/products/redcarpet/

Subscribe to channels

Search, install, & remove software

Resolves dependencies

Ximian Red Carpet pro’s:

Free

Easy to use

Updates virtually all system software & lots of 3rd party software

Command-line client, but still in development

Ximian Red Carpet con’s:

Runs only on Red Hat 7-9, Red Hat Enterprise, Fedora Core, Mandrake 9, & SUSE

Slow

“Ximianizes” your system (not so much any longer)

Ximian Red Carpet Enterprise

Designed to manage software installations on multiple workstations

Red Hat/Fedora Core Update Agent, up2date

Update software

up2date con’s:

Clumsy & poorly designed

Must register with Red Hat

SUSE’s YOU: YaST2 Online Update

Get information about software updates

YaST2 Online Update pro’s:

Free

Easy to use

Can be configured to work automatically

Updates all software included with SUSE system

YaST2 Online Update con’s:

Only updates SUSE system software; no 3rd party software

Sometimes slow to connect to servers

Debian APT

(Advanced Package Tool)

How APT works

Install new packages, update already-installed packages, & remove packages you no longer want.

If there are dependencies, APT resolves them.

You can update the entire distribution.

APT pro’s:

Free

Command-line & GUI tools available

Powerful

Can update virtually every piece of software on your system: 16,000+ packages are currently available!

APT is native to Debian, but it has ported over to work with RPM-based systems (Red Hat & SUSE)

APT con’s:

Robert, being a weenie, has a hard time understanding it :)

Can be difficult to master all the in’s & out’s

Files on your system used by APT

/etc/apt/sources.list

Contains the list of APT repositories, where the software is (may be on Net, LAN, CD, or local)

/etc/apt/preferences

Allows you to set “pinning” order (more on that later)

/etc/apt/apt.conf

Set configuration options for APT

Let’s take a look at your APT system files

cat /etc/apt/sources.list | less

(Press space or f to go down a screen at a time,

b to go back up a screen at a time,

& p to go back to the 1st screen

... or you can use the arrow keys

to move one line at a time;

press q to quit)

cat /etc/apt/preferences | less

cat /etc/apt/apt.conf | less

Using APT on the command line

(all commands run as root)

apt-get update

1st time run, it downloads files from repositories containing lists of software.

After that, it compares installed software to the repositories.

A. If similar, repository file is skipped

B. If different, repository file is downloaded

apt-get upgrade

Downloads & installs any software upgrades.

If there are dependencies, it tells you about them & asks you if you want to download them.

Software that is “kept back” requires your explicit request for installation.

You’re going to be running the previous two commands a lot.

Much easier to create an alias in your .bashrc file.

alias upgrade='apt-get update && apt-get upgrade'

If update succeeds, upgrade commences. If update fails, upgrade will not commence.

Want to simulate an upgrade without actually doing it, just so you can see what would happen?

apt-get upgrade -s

(by the way, -s works for just about every apt-get command, so feel free to try it with something you’re not sure of)

apt-cache search search-word(s)

Shows package(s) whose name or description matches search-word(s).

apt-cache show package-name

Shows information about package(s) currently installed & what’s available to install.

apt-cache showpkg package-name

Shows information about package(s) referenced, including versions and dependencies.

apt-get install package-name

Installs requested package(s).

Example:

apt-get install gcc-3.3 gcc-3.3-base

(As soon as you install Libranet, run this –

apt-get install apt – which upgrades APT)

apt-get remove package-name

Removes requested package(s)

Example:

apt-get remove gcc-3.3 gcc-3.3-base

Sick of answering a million questions every time you install or upgrade packages?

The program that asks those questions is “debconf”.

dpkg-reconfigure debconf

Reconfigures debconf so it only asks you important questions.

Choose “Critical” & you’ll be asked far fewer questions.

Here’s a tip: if you ever want to answer questions for any package again, try dpkg-reconfigure.

dpkg-reconfigure package-name

One really great feature of APT occurs when you install this:

apt-get install apt-listbugs

Now when you run APT, packages will be downloaded, but before installation, APT will check Debian’s buglist to see if there are any showstopper bugs for any of your packages.

If there are bugs, you will be warned & asked if you wish to proceed.

If apt-listbugs does find bugs, copy the number of the bug & enter it in at http://www.debian.org/Bugs to see the status of the bug.

Sometimes it might not be such a big deal, and you can safely go ahead and install the package.

Sometimes it would be a hugely disastrous deal, and you wait until the bug is resolved!

Using APT with a GUI:

Synaptic

Synaptic is already included with Libranet,

but if it wasn’t:

apt-get install synaptic

To run Synaptic from the command line (as root):

synaptic &

To run Synaptic using the GUI:

K menu > System > Debian > Synaptic Package Manager

or

K menu > System > Synaptic Package Manager

Configure Synaptic

View menu > Flat List

Choose which packages you want to see

To understand APT Pinning,

we first need to talk about

the three (really, four)

Debian releases.

In order, from most stable to most bleeding edge:

1. Woody, aka Stable

2. Sarge, aka Testing

3. Sid, aka Unstable

4. Experimental

apt-get upgrade -t unstable

Shows you all upgrades currently available in Sid (an enormous list).

If you say “Y”, you will be running a straight Sid system, instead of the mixed Woody/Sarge/Sid system that is Libranet.

Therefore, say “n” & pick & choose as needed.

apt-get install widget foobar -t unstable

Installs packages widget & foobar from Sid.

If other packages are needed, they will be downloaded & installed.

After a while, you’re going to have a lot of installers (deb packages) on your computer.

They’re located in /var/cache/apt/archives/

apt-get clean

Removes the previously installed deb’s.

APT resources

APT HOWTO

http://www.debian.org/doc/manuals/apt-howto/index.en.html

A Very Apropos apt

http://www.linux-mag.com/2003-10/apt_01.html

(Focuses on APT for RPM, but still relevant to Debian-users)

Thank you!

Email me: scott@granneman.com

Visit my Web site: www.granneman.com

Join GranneNotes:

grannenotes-subscribe@yahoogroups.com

Read my blog: blog.granneman.com

Licensing of this work

This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit

http://creativecommons.org/licenses/by-sa/1.0 or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

In addition to the rights and restrictions common to all Creative Commons licenses, the Attribution-ShareAlike License features the following key conditions:

Attribution. The licensor permits others to copy, distribute, display, and perform the work. In return, licensees must give the original author credit.

Share Alike. The licensor permits others to distribute derivative works under a license identical to the one that governs the licensor's work.

Questions? Email scott@granneman.com

Scott Granneman

2004-03-05T22:31:16