Bug 1274211

Summary: [RFE] Add strict mode to yum to return error if any requested packages were not available
Product: Red Hat Enterprise Linux 7 Reporter: Stephen Tweedie <sct>
Component: yumAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: urgent Docs Contact: Jiri Herrmann <jherrman>
Priority: high    
Version: 7.2CC: bbaude, brian.murrell, emrakova, hxx_118, james.antill, jherrman, jjarvis, mkolbas, vmukhame
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: yum-3.4.3-133.el7 Doc Type: Release Note
Doc Text:
New "skip_missing_names_on_install" and "skip_missing_names_on_update" options for *yum* The "skip_missing_names_on_install" and "skip_missing_names_on_update" options have been added to *yum* repository configuration. With "skip_missing_names_on_install" set to "False" in the `/etc/yum.conf` file, using the "yum install" command fails if *yum* cannot find one of the specified packages, groups, or RPM files. With "skip_missing_names_on_update" set to "False", using the "yum update" command fails if *yum* cannot find one of the specified packages, groups, or RPM files, or if they are available, but not installed.
Story Points: ---
Clone Of:
: 1358495 (view as bug list) Environment:
Last Closed: 2016-11-04 05:29:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1267234    
Bug Blocks: 1289025, 1296649, 1299750, 1313485, 1358495, 1384256    

Description Stephen Tweedie 2015-10-22 09:34:40 UTC
Description of problem:
"yum install" currently returns success if any of the requested packages were installed.  This masks errors if some of those packages were unavailable.

In a build environment (such as "docker build" executing a Dockerfile), failure to install a package is an error condition and should fail the build.  Otherwise the user is left debugging an incompletely built environment.

Failures can happen for all sorts of reasons --- transient errors, misconfigured repos or entitlement, or simple typos; and it is important to give the user prompt feedback when such failures occur, and to fail automated builds.


The preferred solution would allow us to configure a docker base image to select strict error handling for such cases as a default, without users being required to manually add a yum command line switch.  A yum.conf setting or installable yum plugin would work, for example.

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

Comment 1 James Antill 2015-10-26 15:45:57 UTC
Note that one way to do this that works in el7.0 is:

ENV ipkgs zsh aslfjalf vim-enhanced iftop
RUN sh -c "for i in ${ipkgs}; do yum -y install-n \$i || exit 1; done"

Comment 7 John Jarvis 2016-03-02 15:08:58 UTC
Flagging for RHEL 7.2.z review.

Comment 21 Valentina Mukhamedzhanova 2016-06-28 12:42:38 UTC
*** Bug 1349693 has been marked as a duplicate of this bug. ***

Comment 28 errata-xmlrpc 2016-11-04 05:29:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2397.html

Comment 29 Valentina Mukhamedzhanova 2017-06-08 08:54:10 UTC
*** Bug 1429685 has been marked as a duplicate of this bug. ***