• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1014
  • Last Modified:

RPM return codes

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,
-Jim
0
jim_welch_se
Asked:
jim_welch_se
  • 2
1 Solution
 
jlevieCommented:
rpm returns 0 for success and 1 for error. Examining $? after executing rpm will tell you if the command succeeded or not.
0
 
jim_welch_seAuthor Commented:
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?

-Jim
0
 
jlevieCommented:
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.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now