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: RPM and YUM package management

Exercises for setting up your Linux system and software

Tracy Bost, Consultant and Trainer, Freelance
Author photo - Tracy Bost
Tracy Bost is a seasoned software developer and systems engineer. He is also a lecturer and trainer for the Linux operating system. Tracy has been certified as both a Red Hat Certified Engineer (RHCE) and a Microsoft Certified Systems Engineer (MCSE), along with being an active member of the Linux Foundation. He has worked in several industries, including mortgage, real estate, and the nonprofit sector.

Summary:  A package is software that is bundled and ready for installation on a Linux system, and installing and removing packages are basic operations for any Linux user or administrator. This article offers hands-on practice with the Red Hat Package Manager (RPM) and YUM software management tools that will help you learn to perform 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:  Intermediate PDF:  A4 and Letter (147 KB | 5 pages)Get Adobe® Reader®
Also available in:   Chinese  Korean  Portuguese

Activity:  25972 views
Comments:  

About this article

These exercises and solutions supplement the developerWorks article "Learn Linux, 101: RPM and YUM 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 "RPM and YUM package management" article before working through these exercises.

Overview

These exercises give you practice performing:

  • Package management with the RPM Package Manager (RPM)
  • Software management with Yellowdog Updated Modified (YUM)

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 exercises in this series, you should have a basic knowledge of Linux and a working RPM-based Linux system on which you can practice the exercises covered in this article.


Exercise 1. Install an RPM package

The rpl search and replace tool

rpl is a widely available GNU-licensed utility that replaces strings in text. Obtain a copy of the latest stable rpl package (as of this writing, rpl 1.5). For example, a Fedora 15 version will appear as rpl-1.5.5-4.fc15.noarch.rpm. This naming convention indicates that the RPM is rpl version 1.5.5-4, compiled for Fedora 15, with a generic build that should suffice for any architecture.

Because you will not work directly with the commands of rpl, any valid RPM package will be sufficient to complete this exercise.

Although more advanced software management tools such as YUM have gained wide acceptance, the rpm command still has its place in many systems administrator scenarios. Likewise, many third-party commercial Linux-based applications can be downloaded as RPM files.

Assume that you are working for an organization that just acquired another company. You have been tasked with changing thousands of lines among multiple Extensible Markup Language (XML) files from the previous company's name to the new name. The rpl command can do just that:

  • Find and download the latest stable RPM package for rpl.

This exercise doesn't focus on YUM, but as an alternative to downloading the rpl rpm file from a reputable mirror site, you could use the yumdownloader command if rpl is available in one of your computer's enabled YUM repositories. The command yumdownloader rpl will download the file.

Once the RPM file is downloaded:

  • Use the rpm command to install the package with flags for verbose output and hashes (#) to show progress.

The rpm --help command will assist you with the correct syntax for these flags.


Exercise 2. Use RPM to query for information

Use the rpm command to:

  • Verify that the package is installed on your computer
  • Find all files associated with the package
  • Determine which package owns the /bin/ls file

Exercise 3. Use RPM to remove a package

You have completed the task to replace the company name in thousands of places among multiple files in record time using the rpl tool. However, you don't anticipate using rpl in the near future, so you decide to uninstall the program to save disk space (actually, rpl is a tiny program) and minimize the number of installed software programs on your computer.

  • Use the rpm command to remove the rpl program from your Linux computer.

Exercise 4. Use YUM to find information about software

This exercise covers the use of YUM to automatically discover and install dependencies, find information about available software from enabled YUM repositories on your computer, and install and remove software.

Perhaps you are performing a job requiring a lot of command-line processing with arguments and would like to set a few aliases. The tcsh (pronounced tee-see-shell) can do exactly that. Tcsh is a widely available shell that most likely is not installed on your computer but is available from your YUM repository.

  • Use the yum command to perform these tasks:
    • Determine whether tcsh is available within an enabled YUM repository on your computer
    • Find information about tcsh
    • Determine the dependencies, if any, that tcsh will require

Exercise 5. Use YUM to install software

Now you are ready to install the new software.

  • Use the yum command to perform these tasks:
    • Install tcsh
    • Verify that tcsh is installed on your computer

Exercise 6. Use YUM to remove software

As in exercise 3, remove the software to manage disk space and prevent the need for any future updates to tcsh:

  • Use the yum command to remove tcsh.

Exercise solutions

Follow these solution steps to check your work.


Resources

About the author

Author photo - Tracy Bost

Tracy Bost is a seasoned software developer and systems engineer. He is also a lecturer and trainer for the Linux operating system. Tracy has been certified as both a Red Hat Certified Engineer (RHCE) and a Microsoft Certified Systems Engineer (MCSE), along with being an active member of the Linux Foundation. He has worked in several industries, including mortgage, real estate, and the nonprofit sector.

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=681827
ArticleTitle=Practice: RPM and YUM 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