Issue
Take the kernel rpm for example, it allows multiple versions to be installed concurrently on a system. What exactly in the spec file permits that?
I want to package a project that already exists as multiple versions with distinct installation prefixes.
Solution
YUM
Found the way to have yum install instead of update. There's a configuration directive to do so. From man yum.conf:
installonlypkgs
List of package provides that should only ever be installed, never updated. Kernels in particular fall into this category. Defaults to kernel, kernel-bigmem, kernel-enterprise, kernel-smp, kernel-debug, kernel-unsupported, kernel-source, kernel-devel, kernel-PAE, kernel-PAE-debug.
Note that because these are provides, and not just package names, kernel-devel will also apply to kernel-debug-devel, etc.
Note that "kernel-modules" is not in this list, in RHEL-6, and so anything providing that is updated like any other package.
installonly_limit
Number of packages listed in installonlypkgs to keep installed at the same time. Setting to 0 disables this feature. Default is '3'. Note that this functionality used to be in the "installonlyn" plugin, where this option was altered via tokeep. Note that as of version 3.2.24, yum will now look in the yumdb for a installonly attribute on installed packages. If that attribute is "keep", then they will never be removed.
Tested and confirm it replicates the behavior with kernel. When updating or installing, yum will not update (remove) the old package.
Note that the package name in the list must be exact, it doesn't consider wildcards. So there a way to do it, and likely automate the process in the rpm's %post script.
Answered By - Vanista Answer Checked By - Katrina (WPSolving Volunteer)