Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Getting Started with RPMs

February 22, 2013
Langdon White
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

Share:

    Unfortunately, not every application is packaged for every distribution. What do you do when you can't find it packaged for Red Hat Enterprise Linux? If you are like most people, you give up or attempt to install it from source. What happens when installing from source goes badly? If you are like most people, you definitely give up. How do you keep up with application improvements or, perhaps more importantly, security fixes? If you are like most people, you periodically try and check on the application status (especially when your version stops working :) ), and then try and rebuild it. What is the solution to all of these issues? Proper packaging. Well, this post is meant to help you get started.

    For many folks, the barrier to entry for RPMs is understanding what exactly "RPM creation" really means. We all know the “point” of an RPM (or packaging in general) is to support dependency management for libraries and applications. However, what does that really mean? What are the pieces of an RPM? What do you need to create one? How do you get started with something small? Everything written about RPMs seems to be geared to doing everything “right” or as if you wanted to package your own application. Sometimes, when you just need to get something installed, you just need the quick and dirty version.  Hopefully, this post will get you started with an overview and pointers to next steps.

    In short, creating an RPM involves four steps:

    1. get the application source to build on your system
    2. take careful notes on what you did while building the application (in what is called a “spec file”)
    3. create the “RPM creation” directory structure and build the RPM
    4. try to build/install the app into a pretend, clean system (to test it)

    To get started, you should first build a VM that you can dedicate to RPM creation which should simplify your processes. Create a VM with a fresh install of Red Hat Enterprise Linux of whatever version you are targeting. Minor version “shouldn't” matter but it might save you some headaches down the road if you pick the right one. When you create the VM you may want to mount a dedicated virtual disk at /rpm-builds just so you can reuse some of your work if you need to upgrade/downgrade the OS.

    Assuming that the first package you want to build is an existing application that just hasn't been packaged or repackaged for Red Hat Enterprise Linux yet, you will likely want to spend some time looking for an existing attempt at packaging the application. If you can find a Source RPM or an existing spec file it will make your life much easier and be a better way to get started. You can search for things like “source rpm <app-name>,” “srpm <app-name>,” or “spec <app-name>” to try and find existing places to start. You can also look at existing spec file repositories for hints, for example the repoforge spec files are stored at github. Finally, you can sometimes find initial attempts at packaging in the “bug lists” for the various repos, for example repoforge issues and EPEL bugs (product “Fedora EPEL”), which may not give you the spec file but lead you to the source control repo that does have it.

    Now that you have a bit more of an overview of what is involved in the RPM creation process you can move on to the more definitive guides.

    • How to Build an RPM at the Red Hat Customer Portal
    • A three part series at IBM DeveloperWorks
    • The definitive Fedora How to Create an RPM Guide
    • A simple, arbitrary, step-by-step example, the GNU Hello RPM package

    In a future post, we will walk through the creation of a simple, but useful, application package.

    Last updated: January 9, 2023

    Recent Posts

    • Customize RHEL CoreOS at scale: On-cluster image mode in OpenShift

    • How to set up KServe autoscaling for vLLM with KEDA

    • How I used Cursor AI to migrate a Bash test suite to Python

    • Install Python 3.13 on Red Hat Enterprise Linux from EPEL

    • Zero trust automation on AWS with Ansible and Terraform

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue