Bug 1274211 - [RFE] Add strict mode to yum to return error if any requested packages were not available
[RFE] Add strict mode to yum to return error if any requested packages were n...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum (Show other bugs)
7.2
Unspecified Unspecified
high Severity urgent
: rc
: ---
Assigned To: Valentina Mukhamedzhanova
Eva Mrakova
Jiri Herrmann
: FutureFeature
: 1349693 1429685 (view as bug list)
Depends On: 1267234
Blocks: 1296649 1299750 1313485 1384256 1289025 1358495
  Show dependency treegraph
 
Reported: 2015-10-22 05:34 EDT by Stephen Tweedie
Modified: 2017-07-20 11:23 EDT (History)
9 users (show)

See Also:
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 01:29:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephen Tweedie 2015-10-22 05:34:40 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
Comment 1 James Antill 2015-10-26 11:45:57 EDT
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 10:08:58 EST
Flagging for RHEL 7.2.z review.
Comment 21 Valentina Mukhamedzhanova 2016-06-28 08:42:38 EDT
*** Bug 1349693 has been marked as a duplicate of this bug. ***
Comment 28 errata-xmlrpc 2016-11-04 01:29:54 EDT
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 04:54:10 EDT
*** 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.