如何让rpm自动安装依赖 [英] How to make rpm auto install dependencies

查看:110
本文介绍了如何让rpm自动安装依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经构建了两个 RPM 包

I have built two RPM packages

  • proj1-1.0-1.x86_64.rpm
  • libtest1-1.0-1.x86_64.rpm

proj1 取决于存在的文件 libtest1.so,它在 RPM 包中正确反映,如下所示:

proj1 depends on the file libtest1.so being present and it is reflected correctly in the RPM packages as seen here:

user@my-pc:~$ rpm -qp --requires proj1-1.0-1.x86_64.rpm
libtest1.so()(64bit)

user@my-pc:~$ rpm -qp --provides libtest1-1.0-1.x86_64.rpm
libtest1.so()(64bit)

由于缺少依赖项,proj1 的安装失败.

The installation of proj1 fails due to a missing dependency.

user@my-pc:~$ rpm -ivh proj1-1.0-1.x86_64.rpm
error: Failed dependencies:
libtest1.so()(64bit) is needed by proj1-1.0-1.x86_64.rpm

如何确保libtest1-1.0-1.x86_64.rpm 自动安装proj1-1.0-1.x86_64.rpm的安装?

How do I ensure that libtest1-1.0-1.x86_64.rpm is installed automatically during the installation of proj1-1.0-1.x86_64.rpm?

我确实尝试了 --aid 选项和 rpm -i 所述这里 但它对我不起作用.

I did try the --aid option with rpm -i as described here but it didn't work for me.

还有什么办法吗?

感谢您的帮助.

推荐答案

创建一个(本地)存储库并使用 yum 让它为您解析依赖项.

Create a (local) repository and use yum to have it resolve the dependencies for you.

CentOS wiki 有一个很好的页面,提供了有关此的操作方法.CentOS wiki HowTos/CreateLocalRepos.

The CentOS wiki has a nice page providing a how-to on this. CentOS wiki HowTos/CreateLocalRepos.

总结并进一步最小化(不理想,但最快):

Summarized and further minimized (not ideal, but quickest):

  1. 为您的本地存储库创建一个目录,例如/home/user/repo.
  2. 将 RPM 移动到该目录中.
  3. 修复一些所有权和文件系统权限:

  1. Create a directory for you local repository, e.g. /home/user/repo.
  2. Move the RPMs into that directory.
  3. Fix some ownership and filesystem permissions:

# chown -R root.root /home/user/repo

  • 如果尚未安装,请安装 createrepo 包,然后运行

    # createrepo /home/user/repo
    # chmod -R o-w+r /home/user/repo
    

  • 创建存储库配置文件,例如/etc/yum.repos.d/myrepo.repo 包含

    [local]
    name=My Awesome Repo
    baseurl=file:///home/user/repo
    enabled=1
    gpgcheck=0
    

  • 使用

  • Install your package using

    # yum install packagename
    

  • 这篇关于如何让rpm自动安装依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆