Search code examples
rpmrpmbuildrpm-spec

How can I force Anaconda to install my package after coreutils?


I have a customized RPM that builds a set of subpackages. Each subpackage has a %post script in the spec file that is used to copy some symlinks to another folder:

%post server
echo "Copying symlinks..." >> /tmp/mystuff.log
pwd >> /tmp/mystuff.log
cp -av /etc/mystuff/symlinks/server/current /etc/mystuff/ >> /tmp/splashtheme.log 2>&1

When I install one of the subpackage RPMs on a running system, it works fine. When I install it via Anaconda (as part of a Kickstart package list), the RPM's post-install scripts do not seem to run.

Edit: As it turns out, they actually do run, but I'm getting an error that says:

/var/tmp/rpm-tmp.48901: line 3: cp: command not found

Apparently, Anaconda is attempting to install my RPM before it installs coreutils, even though I specify coreutils as a dependency in Requires:.

So, my revised question is the title: How can I force my package to be installed after coreutils?


Solution

  • @Justin, you're being lucky that that works as anaconda could still install them in a different order if its in the same transaction. What you need is:

    Requires: coreutils
    Requires(post): coreutils
    

    That way anaconda/rpm will ensure that core utils is installed prior to your %post being run.