Bug 1274211 - [RFE] Add strict mode to yum to return error if any requested packages were not available
Summary: [RFE] Add strict mode to yum to return error if any requested packages were n...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Valentina Mukhamedzhanova
QA Contact: Eva Mrakova
Jiri Herrmann
: 1349693 1429685 (view as bug list)
Depends On: 1267234
Blocks: 1296649 1313485 1384256 1289025 1299750 1358495
TreeView+ depends on / blocked
Reported: 2015-10-22 09:34 UTC by Stephen Tweedie
Modified: 2017-07-20 15:23 UTC (History)
9 users (show)

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.
Clone Of:
: 1358495 (view as bug list)
Last Closed: 2016-11-04 05:29:54 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2397 normal SHIPPED_LIVE yum bug fix and enhancement update 2016-11-03 13:55:12 UTC

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):

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.


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

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