Red Hat Bugzilla – Bug 1274211
[RFE] Add strict mode to yum to return error if any requested packages were not available
Last modified: 2017-07-20 11:23:31 EDT
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
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"
Flagging for RHEL 7.2.z review.
*** Bug 1349693 has been marked as a duplicate of this bug. ***
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
*** Bug 1429685 has been marked as a duplicate of this bug. ***