Debian Package Management, Part 1: A User's Guide

A HOWTO for Debian package management.
Upgrading

I have not yet found another distribution that makes upgrading to a new version as easy as Debian does. As mentioned previously, when you want to upgrade your version, simply change the distribution part of the URI in /etc/apt/sources.list, then do an apt-get dist-upgrade. Often, it helps to run apt-get dist-upgrade a few times to get everything happily installed and configured. You can only use this to go to a newer version, from stable to frozen, stable to unstable or frozen to unstable. You cannot downgrade.

apt-cache

apt-cache is great for finding information about packages, even packages you don't have installed! The command apt-cache show <package> will print various information about the package, including dependencies, full name, what it provides, the short and long descriptions, and, most importantly, the size when unpacked. apt-cache depends <package> provides a list of what other packages the selected <package> needs installed to work properly. To print a complete list of every package available, use apt-cache pkgnames.

The most useful feature of apt-cache that I've found has to be apt-cache search <string>. This option will search through all package names and descriptions looking for occurrences of your <string> selection. Obviously, this can be a great time-saving device.

To further assist your managing capabilities, there are some options that apt-cache can utilize. For example, -i lists only the important dependencies, -f prints full records (just like “show”) after a search and -names-only limits searches to package names.

Frontends!

While I can usually get by with dpkg for package management, apt-cache for searching and apt-get for installation, sometimes I want to get a better idea of what's available to me. This is where dselect, console-apt and gnome-apt come in.

dselect

dselect is the granddaddy of the Debian frontends. As the first part of the installation process, it is the first thing new Debian users are greeted with, and it scares them. And it's true that dselect can be incredibly scary as well as incredibly dense. This section will be the short and sweet introduction to dselect. First, my best advice when using dselect is to read all of the on-screen help. Although not very user-friendly, everything you need to know is contained there.

Figure 1. Dselect-Inspection of Package States

When you first start dselect, you'll want to go to “[A]ccess” to select the correct access method for installation. Meaning, select “nfs” if you have a local nfs mirror of Debian, and “apt” if you want to install over the Internet (http/ftp) or if you've configured your sources.list for local addresses. Other methods available are CD, Multi-CD (if your distribution has multiple CD-ROMs as opposed to one), Floppy and Mounted.

Once you've selected your access method, dselect needs to find out what packages it has access to; to accomplish this, select “[U]pdate” and wait a minute.

“[S]elect” is where the actual package management happens. First, you'll be presented with a help screen. READ IT! When you finish READING IT, press space to get out of help or “.” to read the keybindings. You can move around the package listings by searching or by using up/down, page-up/page-down, home/end and left/right. The following are some basic, useful keystrokes in dselect:

/ search\ repeats the last search? brings up helpd scrolls down the package informationu scrolls up it

When you've highlighted a package you want to do something with, use:

+ install or upgrade- remove= leave in present state

When you're ready to leave the selection screen, select:

<enter> to confirm, quit and check dependenciesQ to quit, confirm and override dependenciesX or Esc to abandon all changes

After you press return, you may be presented with a list of packages; these may be either dependencies of or conflicts with the packages you selected. Look at the packages; the bottom half of the screen will tell you what the problem is. Once you've resolved these problems, press enter.

After you've made your changes in “[S]elect”, either “[I]nstall” or “[R]emove” which will bring your system up to date with the changes. “[C]onfig” is only necessary if any package configuration failed.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState