收集软件包制作定制CentOS DVD所需的所有RPM。 [英] Collect all RPMs that are needed by a package to make a custom CentOS DVD

查看:135
本文介绍了收集软件包制作定制CentOS DVD所需的所有RPM。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从CentOS仓库中复制构建DVD的自定义版本所需的所有RPM。



基本上,我需要完整的列表自定义RPM所需的软件包中的一部分,以便可以将其复制到我正在构建的ISO映像中。



我这里有一个自定义RPM,不在



当我执行rpm -qpR时,它很接近,但是它列出的不是带有路径名或包的文件。

p>

文件很容易,因为我可以使用repoquery --qf ='%{name}'-f文件名



包也很容易,因为它们正是我所需要的。



但是我从rpm -qpR得到依赖,例如config(alsa-lib)和rtld(GNU_HASH)既不打包也不文件也不库。



我正在考虑只说其中带有()的依赖项(空的()除外)可以跳过吗?

$ b




$ b

空的()我会使用repoquery来获取软件包,因为它是一个库。像:
libc.so.6()(64位)
libc.so.6(GLIBC_2.14)(64位)
libc.so.6(GLIBC_2.16)(64位)
libc.so.6(GLIBC_2.2.5)(64bit)
。。。



很多版本的GLIBC。我正在考虑只是从我的仓库中安装了最新版本,因为glibc显示为软件包。这样安全吗?

解决方案

有几个问题要问(您可能会考虑重构问题)。以下是一些答案:




  • repoquery 可能对部署应用程序很有用,但对分析所需的RPM集却没有多大用处。其中,给定文件的普通 rpm -qf将标识软件包名称,并更快地执行。

  • rpm 的联机帮助页是一个不错的起点。它具有 -R 选项:列出此程序包所依赖的功能。

  • rpm 还具有-提供的内容查询所有提供CAPABILITY功能的软件包。



大体上,您的问题似乎忽略了功能。这些可能是特定的文件,或者可能是其他引用包和/或其内容的方式的名称。例如,

  $ rpm -qR`rpm -qf vi` 
config(vim-minimal)= 2:7.4.629-5.el6
libacl.so.1()(64位)
libacl.so.1(ACL_1.0)(64bit)
libc.so.6( )(64位)
libc.so.6(GLIBC_2.11)(64位)
libc.so.6(GLIBC_2.2.5)(64位)
libc.so.6(GLIBC_2。 3)(64位)
libc.so.6(GLIBC_2.3.4)(64位)
libc.so.6(GLIBC_2.4)(64位)
libselinux.so.1() (64位)
libtinfo.so.5()(64位)
rpmlib(CompressedFileNames)< = 3.0.4-1
rpmlib(FileDigests)< = 4.6.0-1
rpmlib(PayloadFilesHavePrefix)< = 4.0-1
rpmlib(VersionedDependencies)< = 3.0.3-1
rtld(GNU_HASH)
rpmlib(PayloadIsXz)<= 5.2- 1

这些行是功能,例如

  $ rpm -q-提供'libtinfo.so.5()(64bit)'
ncurses-libs-5.7-4.20090207.el6 .x86_64

要完成任务,您应该递归地遵循这些功能,直到您可以到达(并且可能会忽略)基本系统中的软件包。一些软件包提供了多种功能:

  $ rpm -q --whatprovides'config(vim-minimal)= 2:7.4.629 -5.el6'
没有软件包提供config(vim-minimal)= 2:7.4.629-5.el6
$ rpm -q-提供'libacl.so.1()(64bit) '
libacl-2.2.49-6.el6.x86_64
$ rpm -q-提供了'libacl.so.1(ACL_1.0)(64bit)'
libacl-2.2。 49-6.el6.x86_64
$ rpm -q-提供'libc.so.6()(64bit)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q-提供'libc.so.6(GLIBC_2.11)(64位)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q-提供'libc。 so.6(GLIBC_2.2.5)(64bit)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q-提供'libc.so.6(GLIBC_2.3)( 64位)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q-提供'libc.so.6(GLIBC_2.3.4)(64位)'
glibc- 2.12-1.166.el6_7.3.x86_64
$ rpm -q-提供'libc.so.6(GLIBC_2.4)(64bit)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q --whatprovides'libselinux.so.1( )(64bit)'
libselinux-2.0.94-5.8.el6.x86_64
$ rpm -q-提供'libtinfo.so.5()(64bit)'
ncurses-libs -5.7-4.20090207.el6.x86_64
$ rpm -q-提供'rpmlib(CompressedFileNames)< = 3.0.4-1'
没有软件包提供rpmlib(CompressedFileNames)< = 3.0.4 -1
$ rpm -q-提供'rpmlib(FileDigests)< = 4.6.0-1'
没有软件包提供rpmlib(FileDigests)< = 4.6.0-1
$ rpm -q --whatprovides'rpmlib(PayloadFilesHavePrefix)< = 4.0-1'
没有软件包提供rpmlib(PayloadFilesHavePrefix)< = 4.0-1
$ rpm -q --whatprovides'rpmlib( VersionedDependencies)< = 3.0.3-1'
没有软件包提供rpmlib(VersionedDependencies)< = 3.0.3-1
$ rpm -q-提供'rtld(GNU_HASH)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q-提供'rpmlib(PayloadIsXz)< = 5.2-1'
没有软件包提供rpmlib(PayloadIsXz)< = 5.2 -1

无包提供提示在特殊cas此选项未解决的问题。例如,参见 rpmlib 情况msg00283.html rel = nofollow>回复:rpmlib(VersionedDependencies)< = 3.0.3-1 ,它表示 rpm --showrc 提供信息。 (vim-minimal警告是另一种特殊情况-您将在其他人出现时对其进行处理。)



无需安装RPM来查找内容它提供的功能。您可以使用-provides 选项来做到这一点,例如,

  rpm -qp-提供您的软件包名称.rpm 

和(如前所述)使用 -R 选项查看给定软件包需要的内容:

  rpm -qpR your-package-name.rpm 

查看软件包I为 ncurses-examples 构建的,这两个命令给了我

  $ rpm -qp-提供ncurses-examples-6.0-20151107.x86_64.rpm 
ncurses-examples = 6.0-20151107
ncurses-examples(x86-64)= 6.0-20151107

$ rpm -qpR ncurses-examples-6.0-20151107.x86_64.rpm
libc.so.6()(64位)
libc.so.6(GLIBC_2.2.5)(64位)
libc.so.6(GLIBC_2.3)(64位)
libformw6.so.6()(64位)
libformw6.so.6(NCURSESW6_5.1.20000708)(64位)
libformw6.so.6(NCURSESW6_5.9.20150530)(64位)
libm.so.6 ()(64位)
libm.so.6(GLIBC_2.2.5)(64位)
libmenuw6.so.6()(64位)
libmenuw6.so.6(NCURSESW6_5.1.20000708) (64位)
libncursesw6.so.6()(64位)
libncursesw6.so.6(NCURSESW6_5.1.20000708)(64位)
libncursesw6.so.6(NCURSESW6_5.3.20021019)(64位) )
libncursesw6.so.6(NCURSESW6_5.4.20040208)(64位)
libncursesw6.so.6(NCURSESW6_5.7.20081102)(64位)
libpanelw6.so.6()(64位)
libpanelw6.so.6(NCURSESW6_5.1.20000708)(64位)
libtinfow6.so.6()(64位)
libtinfow6.so.6(NCURSES6_TINFO_5.0.19991023)(64位)
libtinfow6.so.6(NCURSES6_TINFO_5.1.20000708)(64位)
libtinfow6.so.6(NCURSES6_TINFO_5.4.20040208)(64位)
libtinfow6.so.6(NCURSES6_TINFO_5.7.20081102)(64位) $ b libtinfow6.so.6(NCURSES6_TINFO_5.9.20150530)(64位)
libutil.so.1()(64位)
libutil.so.1(GLIBC_2.2.5)(64位)
rpmlib(CompressedFileNames)< = 3.0.4-1
rpmlib(FileDigests)< = 4.6.0-1
rpmlib(PayloadFilesHavePrefix)< = 4.0-1
rpmlib(PayloadIsXz) < = 5.2-1
rtld(GNU_HASH)

与libc6一样,ncurses6 ABI也需要考虑版本为此,仅匹配()并不一定能获得正确版本的库。


I need to copy all of the RPMs from a CentOS repo that are needed to build a custom version of CentOS for a DVD.

Essentially I need a complete list of the packages needed by my custom RPM so that I can copy them to the ISO image I am building.

I have a custom RPM(s) here that is not in the repo so I can't use yum deplist.

When I do rpm -qpR it is close but it lists things that are not files with pathnames or packages.

Files are easy because I can loop with repoquery --qf='%{name}' -f file-name

Packages are easy too because they are what I need.

But I get dependencies from rpm -qpR like config(alsa-lib) and rtld(GNU_HASH) which are neither packages nor files nor libraries.

I am considering just saying any dependency with a "(" in it, except empty '()' can be skipped. Will this work?

The empty '()' ones I would use repoquery to get the package since it would be a library.

Also I get dependencies like: libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.16)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) . . .

Lots of different versions of GLIBC. I am thinking about just installing the newest one from my repo since glibc shows up as a package. Is this safe?

解决方案

There are several questions asked (you might consider refactoring your question). Here are some answers:

  • repoquery might be useful for deploying your application, but not much use for analyzing the set of needed RPMs. For the use you are making of it, a plain "rpm -qf" for the given files will identify the package name, and do it more rapidly.
  • the manpage for rpm is a good place to start. It has the -R option: List capabilities on which this package depends.
  • rpm also has --whatprovides: Query all packages that provide the CAPABILITY capability..

Largely, your question seems to have overlooked capabilities. Those may be specific files, or they may be names for other ways to refer to packages and/or their contents. For instance, this:

$ rpm -qR `rpm -qf vi`
config(vim-minimal) = 2:7.4.629-5.el6
libacl.so.1()(64bit)  
libacl.so.1(ACL_1.0)(64bit)  
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.11)(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.3)(64bit)  
libc.so.6(GLIBC_2.3.4)(64bit)  
libc.so.6(GLIBC_2.4)(64bit)  
libselinux.so.1()(64bit)  
libtinfo.so.5()(64bit)  
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(VersionedDependencies) <= 3.0.3-1
rtld(GNU_HASH)  
rpmlib(PayloadIsXz) <= 5.2-1

Those lines are capabilities, e.g.,

$ rpm -q --whatprovides 'libtinfo.so.5()(64bit)'
ncurses-libs-5.7-4.20090207.el6.x86_64

To accomplish your task, you should follow those capabilities recursively, until you reach (and presumably disregard) packages in the base system. Some packages provide multiple capabilities:

$ rpm -q --whatprovides 'config(vim-minimal) = 2:7.4.629-5.el6'
no package provides config(vim-minimal) = 2:7.4.629-5.el6
$ rpm -q --whatprovides 'libacl.so.1()(64bit)'
libacl-2.2.49-6.el6.x86_64
$ rpm -q --whatprovides 'libacl.so.1(ACL_1.0)(64bit)'
libacl-2.2.49-6.el6.x86_64
$ rpm -q --whatprovides 'libc.so.6()(64bit)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q --whatprovides 'libc.so.6(GLIBC_2.11)(64bit)'
glibc-2.12-1.166.el6_7.3.x86_64 
$ rpm -q --whatprovides 'libc.so.6(GLIBC_2.2.5)(64bit)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q --whatprovides 'libc.so.6(GLIBC_2.3)(64bit)'
glibc-2.12-1.166.el6_7.3.x86_64       
$ rpm -q --whatprovides 'libc.so.6(GLIBC_2.3.4)(64bit)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q --whatprovides 'libc.so.6(GLIBC_2.4)(64bit)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q --whatprovides 'libselinux.so.1()(64bit)'
libselinux-2.0.94-5.8.el6.x86_64
$ rpm -q --whatprovides 'libtinfo.so.5()(64bit)'
ncurses-libs-5.7-4.20090207.el6.x86_64
$ rpm -q --whatprovides 'rpmlib(CompressedFileNames) <= 3.0.4-1'
no package provides rpmlib(CompressedFileNames) <= 3.0.4-1                      
$ rpm -q --whatprovides 'rpmlib(FileDigests) <= 4.6.0-1'
no package provides rpmlib(FileDigests) <= 4.6.0-1
$ rpm -q --whatprovides 'rpmlib(PayloadFilesHavePrefix) <= 4.0-1'
no package provides rpmlib(PayloadFilesHavePrefix) <= 4.0-1
$ rpm -q --whatprovides 'rpmlib(VersionedDependencies) <= 3.0.3-1'
no package provides rpmlib(VersionedDependencies) <= 3.0.3-1
$ rpm -q --whatprovides 'rtld(GNU_HASH)'
glibc-2.12-1.166.el6_7.3.x86_64
$ rpm -q --whatprovides 'rpmlib(PayloadIsXz) <= 5.2-1'
no package provides rpmlib(PayloadIsXz) <= 5.2-1

The "no package provides" hint at special cases which this option does not address. See for instance the situation with rpmlib discussed in Re: rpmlib(VersionedDependencies) <= 3.0.3-1, which says that rpm --showrc provides the information. (The vim-minimal warning is another special case -- you will handle it and others as they come up).

It is not necessary to install an RPM to find what capabilities it provides. You can do that using the --provides option, e.g.,

rpm -qp --provides your-package-name.rpm

and (as you noted before) use the -R option to see what a given package requires:

rpm -qpR your-package-name.rpm

Looking at a package I built for ncurses-examples, those two commands give me

$ rpm -qp  --provides ncurses-examples-6.0-20151107.x86_64.rpm 
ncurses-examples = 6.0-20151107
ncurses-examples(x86-64) = 6.0-20151107

$ rpm -qpR ncurses-examples-6.0-20151107.x86_64.rpm
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libformw6.so.6()(64bit)
libformw6.so.6(NCURSESW6_5.1.20000708)(64bit)
libformw6.so.6(NCURSESW6_5.9.20150530)(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libmenuw6.so.6()(64bit)
libmenuw6.so.6(NCURSESW6_5.1.20000708)(64bit)
libncursesw6.so.6()(64bit)
libncursesw6.so.6(NCURSESW6_5.1.20000708)(64bit)
libncursesw6.so.6(NCURSESW6_5.3.20021019)(64bit)
libncursesw6.so.6(NCURSESW6_5.4.20040208)(64bit)
libncursesw6.so.6(NCURSESW6_5.7.20081102)(64bit)
libpanelw6.so.6()(64bit)
libpanelw6.so.6(NCURSESW6_5.1.20000708)(64bit)
libtinfow6.so.6()(64bit)
libtinfow6.so.6(NCURSES6_TINFO_5.0.19991023)(64bit)
libtinfow6.so.6(NCURSES6_TINFO_5.1.20000708)(64bit)
libtinfow6.so.6(NCURSES6_TINFO_5.4.20040208)(64bit)
libtinfow6.so.6(NCURSES6_TINFO_5.7.20081102)(64bit)
libtinfow6.so.6(NCURSES6_TINFO_5.9.20150530)(64bit)
libutil.so.1()(64bit)
libutil.so.1(GLIBC_2.2.5)(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
rtld(GNU_HASH)

Like libc6, the ncurses6 ABI has versions to account for, and just matching () alone will not necessarily get the right version of a library.

这篇关于收集软件包制作定制CentOS DVD所需的所有RPM。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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