RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 913461 - yum install returns zero even though some of the packages were not installed
Summary: yum install returns zero even though some of the packages were not installed
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-21 09:56 UTC by michal novacek
Modified: 2014-01-21 06:25 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-19 19:48:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description michal novacek 2013-02-21 09:56:54 UTC
Description of problem:
"yum -y install bash aa" will return zero even thought 'aa' is non-existant.  I
believe that zero should indicate that everything has passed correctly and not
some of the operations passed correctly as it does now. It also is not consistent with  
'yum -y install aa' correctly returning 1.

Version-Release number of selected component (if applicable):
yum-3.4.3-46.el7.noarch

How reproducible: always

Steps to Reproduce:
1. 'yum -y install aa bash'
2. echo $?
  
Actual results:
returns zero

Expected results:
returns non-zero

Additional info:
Please correct it so we can rely on yum to have installed everything he had
been told.

Comment 2 James Antill 2013-02-21 21:58:03 UTC
 This is how it's always worked, yum only complains for install/list/etc. if all the arguments fail (or it results in a depsolve failure, for install).

Comment 3 michal novacek 2013-02-25 13:00:00 UTC
I'm quite sure that it works this way since ever. What I believe is just plain wrong is that zero is returned but not all of the action has been successfully done. 

I do not agree with simply saying that it has always been like this because it is no reasen for returning zero (which says everything worked correctly) in place of returning non-zero (some or all of the things wanted to pass have failed).

Comment 4 James Antill 2013-06-19 19:48:43 UTC
 Again, backwards compatibility is meaningful ... there are a number of cases where it's useful to say:

yum install foo bar baz

...and you only want those packages that are available to be installed. This is even more problematic with other yum commands, and having yum commands act on the arguments to return value differently is not going to help anybody.

 If you really want to check are "X, Y, Z" installed/latest-version/whatever there are ways you can do that efficiently via. the command line or the API.

 If you want even simpler ways to look for specific sets of packages, maybe you could look at an RFE for passing a group of packages to "yum version"?

Comment 5 James Antill 2013-06-19 20:24:05 UTC
 I just added:

http://yum.baseurl.org/gitweb?p=yum.git;a=commitdiff;h=587b4d0f0aad4c38e0c69fadab1407171e274ce6

...and it's building in rawhide now, I think that'll do something useful for you.


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