Skip to content

Commit

Permalink
yum-minimal: pre-install coreutils
Browse files Browse the repository at this point in the history
As described in the referenced bug, the dependency solver in yum
doesn't handle weak dependencies well and in some cases, such as
Fedora 26, can end up choosing coreutils-single (the busybox-esque
single binary) instead of actual coreutils, which then causes problems
with conflicting packages later.

Change-Id: I2907bf3b74c146986b483d52cc6ac437036330b4
  • Loading branch information
ianw committed Jul 18, 2017
1 parent b8ad9c2 commit 6ffde2e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot
Expand Up @@ -157,7 +157,8 @@ function _install_pkg_manager {
flock -w 1200 9 || die "Can not lock .rpmmacros"
echo "%_dbpath /var/lib/rpm" >> $HOME/.rpmmacros

_lang_pack=""
local _lang_pack=""
local _extra_pkgs=""

if [ $DISTRO_NAME = "fedora" -a $DIB_RELEASE -le 23 ]; then
# _install_langs is a rpm macro that limits the translation
Expand All @@ -184,13 +185,21 @@ function _install_pkg_manager {
_lang_pack="glibc-minimal-langpack glibc-langpack-en"
fi

# Yum has some issues choosing weak dependencies. It can end
# up choosing "coreutils-single" instead of "coreutils" which
# causes problems later when a package actually requires
# coreutils. For more info see
# https://bugzilla.redhat.com/show_bug.cgi?id=1286445
# Really all we can do is pre-install the right thing
_extra_pkgs+="coreutils "

sudo -E yum -y \
--disableexcludes=all \
--setopt=cachedir=$YUM_CACHE/$ARCH/$DIB_RELEASE \
--setopt=reposdir=$TARGET_ROOT/etc/yum.repos.d \
--releasever=$DIB_RELEASE \
--installroot $TARGET_ROOT \
install $@ ${_lang_pack} && rc=$? || rc=$?
install $@ ${_lang_pack} ${_extra_pkgs} && rc=$? || rc=$?

# We modified the base system - make sure we clean up always!
rm $HOME/.rpmmacros.dib.lock
Expand Down

0 comments on commit 6ffde2e

Please sign in to comment.