Creating a Package from Source

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

RPM packages allow easy distribution through an organization by allowing the use of YUM repositories. You can use them to build custom packages or in-house modifications to existing packages. In this lab, we will build simple packages to help you understand the process.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Verify the `rpmbuild` Tools Are Installed Correctly

Install the rpmbuild software to package the script:

yum install rpmdevtools -y
Verify the Package Is Installed Correctly
  1. Once the build is complete, install the package:

    yum install ../RPMS/x86_64/myscript-1.0-1.el7.x86_64.rpm
  2. Once installed, run:


Additional Resources

Log in to the provisioned server using the credentials provided.

Our development team has written a script they'd like packaged to ease distribution throughout the environment.

The source for the script is currently in the /root directory. You'll need to create a .tar.gz file from that to ensure the packaging software works correctly.

You've been asked to use the default directories and package the script as the root user.

The script needs to be placed in the /opt/myscript directory.

Once the script is packaged, you should install the package and run the script to verify functionality.

NOTE: An update was made to a package used in this lab that changed some behavior from what is seen in the video. The commands in the lab tasks and lab guide have been updated and should work properly.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!