简体   繁体   中英

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. Images are installed with mount command and supporting libraries with 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.

Thank you,

RPM packages can list requirements on other packages. Those packages, when available, will then automatically be installed when yum is instructed to install the requiring package.

I would use that for the RPM package requirements.

For the "install software from an ISO" part of this there are two, as far as I can see it, options.

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.

If, for some reason, that is not possible then the main (requiring) rpm can manually perform that installation within the %post scriptlet. 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.

There is a way to handle that though actually. RPM spec files can list a file in the %files section as a %ghost . Ghost files are files that do not exist in the RPM itself but which the packaged software will create at some point. Doing this allows rpm (the tool and db) to know about these files and, as such, to remove them upon package removal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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