Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Practice: Debian package management

Exercises for setting up your Linux system and software

Roderick W. Smith, Consultant and author
Roderick Smith author photo
Roderick W. Smith is a consultant and author of over a dozen books on UNIX and Linux, including The Definitive Guide to Samba 3, Linux in a Windows World, and Linux Professional Institute Certification Study Guide. He is also the author of the GPT fdisk partitioning software. He currently resides in Woonsocket, Rhode Island.

Summary:  A package is software that is bundled and ready for installation on a Linux system. Installing and removing packages are basic operations for any Linux user or administrator. This article offers hands-on practice with Debian package management that will help you feel comfortable performing these tasks in a real-world environment. The exercises and solutions in this article focus on a variety of package management tasks.

Date:  21 Jun 2011
Level:  Introductory PDF:  A4 and Letter (140 KB | 5 pages)Get Adobe® Reader®
Also available in:   Chinese  Korean  Portuguese

Activity:  26876 views
Comments:  

About this article

These exercises and solutions supplement the developerWorks article "Learn Linux, 101: Debian package management," which is part of the developerWorks knowledge path "Basics of Linux system administration: Setting up your system and software." You may want to read the "Debian package management" article before working through these exercises.

Overview

These exercises give you practice in:

  • Learning whether a package is installed
  • Searching for a package to be installed on the computer
  • Installing a package using a network repository
  • Finding detailed information on a package
  • Learning which files have been installed from a package
  • Removing a package from the computer

Prerequisites

Develop skills on this topic

This content is part of a progressive knowledge path for advancing your skills. See Basics of Linux system administration: Setting up your system and software

To get the most from the practice exercises in this series, you should have a working knowledge of basic Linux command-line tools. You must also have a Debian-based Linux installation on which to perform the exercises. (This article uses an Ubuntu 11.04 system as a reference, but any Debian or derivative distribution should work.) Some of the exercises require that the computer have a working Internet connection.


Exercise 1. Determine whether a package is installed

The bash shell is great, but you might be itching to explore the vast range of features of the Z shell (zsh), a text-mode command shell that can be used instead of bash. Before looking for a package, it makes sense to check if zsh is already installed.

  • Use the dpkg utility to determine whether the zsh package is installed.

Exercise 2. Search for packages

If it's not already installed, you could hunt around for it in any number of repositories, but there's a good chance you'll find it in your distribution's online package database.

  • Use apt-cache to search for packages that might provide zsh.

Exercise 3. Install a package with APT

Found it? Time to install it.

  • Use apt-get to install the zsh package.

Exercise 4. Determine a package's status

A package's status information can include version information, dependencies on other software, a description of the software, and whether it is properly installed, among other useful things. Say that you installed zsh and now you want to see if the installation went alright.

  • Use dpkg to find extended status information on zsh.

Exercise 5. Identify files associated with a package

Packaged software of any complexity usually consists of multiple files.

  • Use dpkg to identify the files that were installed as part of zsh.

Exercise 6. Uninstall a package

Is Z shell not meeting your needs? Get rid of it.

  • Use apt-get or dpkg to uninstall the zsh package.

Exercise solutions

Follow these solution steps to check your work.


Resources

About the author

Roderick Smith author photo

Roderick W. Smith is a consultant and author of over a dozen books on UNIX and Linux, including The Definitive Guide to Samba 3, Linux in a Windows World, and Linux Professional Institute Certification Study Guide. He is also the author of the GPT fdisk partitioning software. He currently resides in Woonsocket, Rhode Island.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Linux
ArticleID=681814
ArticleTitle=Practice: Debian package management
publish-date=06212011

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers