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
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
dpkgutility 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.
apt-cacheto search for packages that might provide zsh.
Exercise 3. Install a package with APT
Found it? Time to install it.
apt-getto 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.
dpkgto find extended status information on zsh.
Exercise 5. Identify files associated with a package
Packaged software of any complexity usually consists of multiple files.
dpkgto 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.
dpkgto uninstall the zsh package.
Follow these solution steps to check your work.
- The developerWorks article Learn Linux, 101: Debian package management (developerWorks, May 2010) describes the commands required to complete these exercises.
- The document Installing Debian Software with the Advanced Package Tool by Will Trillich describes APT in detail.
- At the LPIC Program site, find detailed objectives, task lists, and sample questions for the three levels of the LPI's Linux systems administration certification. In particular, look at the LPI-101 detailed objectives and the sample questions.
- Review the entire LPI exam prep series on developerWorks to learn Linux fundamentals and prepare for systems administrator certification based on LPI exam objectives prior to April 2009.
- Exam Preparation Resources for Revised LPIC Exams provides a list of other certification training resources that LPI maintains.
Dig deeper into Linux on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Experiment with new directions in software development.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.