RPM return codes

Posted on 2004-11-05
Last Modified: 2011-10-03
Hello All,

I am very new to the Linux/RPM/ & scripting world, and I am writing a install script to launch an rpm.  After launching the rpm I would like to check the return code of the rpm call.  Is there a way to do this.  I've been looking on the web and I can not even find mention of RPM and return codes.  I basically only need to know if the operation was successful or failed.  Any help you can provide will be appreciated.

Best Regards,
Question by:jim_welch_se
    LVL 40

    Accepted Solution

    rpm returns 0 for success and 1 for error. Examining $? after executing rpm will tell you if the command succeeded or not.

    Author Comment

    Hello jlevie,

    I appreciate your answer.  I'm sure this will work for my initial implementation.  Do you know of any list of return codes or are these the only codes returned by RPM?

    LVL 40

    Expert Comment

    0 or 1 is all it returns. If you need to know more about what failed you'd have to parse out the error messages.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now