简体   繁体   English

如何在Linux中将软件集合作为一个软件包安装?

[英]How to install a collection of software as one package in Linux?

I have a collection of libraries and images(iso) and, instead of going one by one, I would like package them up and install all at once with one command. 我有一个库和图像(iso)的集合,而不是一一列举,我想将它们打包并使用一个命令一次安装所有文件。 Images are installed with mount command and supporting libraries with yum . 使用mount命令安装映像,并使用yum支持库。 Is there a better way to do it other than writing a script? 除了编写脚本,还有其他更好的方法吗? Something that will look similar to an rpm than can be installed either locally or remotely. 看起来与rpm类似的东西,可以在本地或远程安装。

Thank you, 谢谢,

RPM packages can list requirements on other packages. RPM软件包可以列出其他软件包的要求。 Those packages, when available, will then automatically be installed when yum is instructed to install the requiring package. 这些软件包(如果有)将在指示yum安装所需软件包时自动安装。

I would use that for the RPM package requirements. 我将其用于RPM软件包要求。

For the "install software from an ISO" part of this there are two, as far as I can see it, options. 据我所知,对于“从ISO安装软件”部分,有两个选项。

The first, and my personal preference, would be to create an RPM out of the built software from the ISO and then simply list that RPM as a requirement and be done. 首先,也是我个人的喜好,是从ISO建立的内置软件中创建一个RPM,然后简单地将该RPM列出为要求并完成。

If, for some reason, that is not possible then the main (requiring) rpm can manually perform that installation within the %post scriptlet. 如果由于某种原因无法实现,则主(需要)rpm可以在%post脚本中手动执行该安装。 The main drawback to this option is that rpm (the tool and db) will know nothing about those files and will not be able to remove them. 此选项的主要缺点是rpm (工具和数据库)对这些文件一无所知,并且无法删除它们。

There is a way to handle that though actually. 尽管有一种解决方法。 RPM spec files can list a file in the %files section as a %ghost . RPM规范文件可以将%files部分中的%files列出为%ghost Ghost files are files that do not exist in the RPM itself but which the packaged software will create at some point. Ghost文件是RPM本身不存在的文件,但打包的软件将在某个时候创建​​这些文件。 Doing this allows rpm (the tool and db) to know about these files and, as such, to remove them upon package removal. 这样做可以使rpm (工具和数据库)知道这些文件,并因此在删除软件包时将其删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM