【问题标题】:rpmbuild install dependencyrpmbuild 安装依赖
【发布时间】:2017-08-27 19:41:30
【问题描述】:

我是 rpmbuild + spec 文件的新手,我尝试了以下 tutorial 来构建“hello world”示例。

设法让它工作,但我想了解依赖项/要求是如何工作的。因此,我尝试复制另一个“hello world 2”示例并将其作为依赖项链接到下面规范文件中的第一个示例。

但是我不断收到以下错误。当我 yum install helloworld2 时,yum install 会选择 helloworld1 并自动安装吗?

有什么例子可以让我学习吗?

规格文件

Name:           helloworld2
Version:        2.0
Release:        1%{?dist}
Summary:        A hello world program

License:        GPLv3+
URL:            https://blog.packagecloud.io
Source0:        helloworld2-2.0.tar.gz

#BuildRequires: helloworld1
Requires(preun):  helloworld1
#PreReq: testYW

%description
A helloworld program from the packagecloud.io blog!

%prep
%setup

%build
make PREFIX=/usr %{?_smp_mflags}

%install
make PREFIX=/usr DESTDIR=%{?buildroot} install
echo %{?buildroot}

%clean
rm -rf %{buildroot}

%files
%{_bindir}/helloworld2

错误

命令 >> yum install RPMS/x86_64/helloworld2-2.0-1.el6.x86_64.rpm

Loaded plugins: product-id, search-disabled-repos, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Examining RPMS/x86_64/helloworld2-2.0-1.el6.x86_64.rpm: helloworld2-2.0-1.el6.x86_64
Marking RPMS/x86_64/helloworld2-2.0-1.el6.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package helloworld2.x86_64 0:2.0-1.el6 will be installed
--> Processing Dependency: helloworld1 for package: helloworld2-2.0-1.el6.x86_64
--> Finished Dependency Resolution
Error: Package: helloworld2-2.0-1.el6.x86_64 (/helloworld2-2.0-1.el6.x86_64)
           Requires: helloworld1
 You could try using --skip-broken to work around the problem

【问题讨论】:

    标签: rpmbuild rpm-spec


    【解决方案1】:

    因为 helloworld2 需要 helloworld1;您应该先安装 helloworld1;要么一起安装。由于 helloworld2 依赖于 helloworld1;如果不先安装 helloworld1(或同时安装),您将无法安装他。

    【讨论】:

      【解决方案2】:

      好呀!我得到了答案! P>

      我可以做百胜安装*的.rpm,其将执行自己的依赖 P>

      否则将所有新rpm文件到库中,它会捡起来:) P>

      【讨论】:

        猜你喜欢
        • 2022-01-06
        • 2021-10-15
        • 2020-01-19
        • 2016-08-21
        • 2016-03-14
        • 2016-07-29
        • 2014-02-12
        • 2019-01-24
        • 2015-04-01
        相关资源
        最近更新 更多