如何强制 Anaconda 在 coreutils 之后安装我的软件包?
我有一个定制的 RPM,它构建了一组子包。每个子包在规范文件中都有一个 %post 脚本,用于将一些符号链接复制到另一个文件夹:
%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
当我在正在运行的系统上安装其中一个子包 RPM 时,它工作正常。当我通过 Anaconda(作为 Kickstart 软件包列表的一部分)安装它时,RPM 的安装后脚本似乎没有运行。
编辑: 事实证明,它们实际上确实运行,但我收到一条错误消息:
/var/tmp/rpm-tmp.48901: line 3: cp: command not found
显然,Anaconda 正在尝试在安装 coreutils 之前安装我的 RPM,即使我将 coreutils 指定为依赖项要求:
。
所以,我修改后的问题是标题:如何强制我的包在 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
@Justin,你很幸运,因为如果在同一事务中,anaconda 仍然可以以不同的顺序安装它们。您需要的是:
这样 anaconda/rpm 将确保在运行 %post 之前安装 core utils。
@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:
That way anaconda/rpm will ensure that core utils is installed prior to your %post being run.
我的规范文件中有错误。我在序言中而不是在 %package 部分中指定了 Requires: 行。这修复了它:
I had an error in my specfile. I had specified the Requires: line in the preamble instead of in the %package section. This fixed it: