Bug 428757 - document yum exit codes
document yum exit codes
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yum (Show other bugs)
All Linux
medium Severity low
: rc
: ---
Assigned To: James Antill
Depends On:
  Show dependency treegraph
Reported: 2008-01-14 18:21 EST by Jan Hutař
Modified: 2009-03-25 02:15 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-25 02:15:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Hutař 2008-01-14 18:21:50 EST
Description of problem:
Please document yum exit values. The only note in a `man yum` is about check-
updates 100/0. 

I'm asking because I just noted, then when I tried to upgrade while one of the 
packages have broken deps I got $? == 1. Usually yum returns 0, or 1 if it 

Version-Release number of selected component (if applicable):

Additional info:
  Make yum more "hackable" with exit codes and/or standardize
  the output to make it easier for shell scripts and one liners
  to interact with
  No. Just no. If you don't like it, go have a conversation
  with yourself about it. Alone. At home. In your closet. 
  Why not?
Comment 1 Jan Hutař 2008-01-16 10:19:25 EST
Just run into another issue - while yum did what I wanted, it ended with 1:

# yum -y install --disablerepo=repo011 --disablerepo=repo022 --downloadonly 
test --downloaddir=.
Downloading Packages:
(1/1): test-0.1-1.i386.rp 100% |=========================| 2.2 kB    00:00
# echo $?
Comment 2 Jan Hutař 2008-01-16 10:22:55 EST
Bad copy&paste:

# yum -y install --disablerepo=repo011 --disablerepo=repo022 --downloadonly 
test --downloaddir=.
Downloading Packages:
(1/1): test-0.1-1.i386.rp 100% |=========================| 2.2 kB    00:00

exiting because --downloadonly specified
# echo $?

And there is this code in /usr/lib/yum-plugins/downloadonly.py:

def postdownload_hook(conduit):
    opts, commands = conduit.getCmdLine()
    if opts.dlonly:
        raise PluginYumExit('exiting because --downloadonly specified ')
Comment 3 James Antill 2008-01-16 10:52:12 EST
 Right, that's how yum-downloadonly works ... it pretends something bad
happened. In theory it could probably call sys.exit(), but this way guarantees
any cleanup needed is done.

Note You need to log in before you can comment on or make changes to this bug.