问题
Currently I am trying to install a rpm secured_soft_2.0.0.rpm and i am unable to install it as we already have secured_soft_1.3.0 installed.
Requirement is that we need to have both the versions installed.
Complexities :
These package inturn have dependent rpm's (lot of them ) and all these interdependent rpm's also have versions ex: secured_soft_1.3.0 works only with packages which are of version 1.3, and secured_soft_2.0.0.rpm work only with dependecies of version 2.0 only. So all these dependencies also need to be reinstalled and even these dependenies should be parallely installed, without deleting old.
Finally , both these versions contain shared libraries and these shared lib's do not have version numbers in their name.
#rpm -ivh secured_soft_2.0.0.rpm
error: Failed dependencies:
init-class >= 1.4.17.1-1 is needed by secured_soft_2.0.0.rpm
init-connection-interface >= 2.0.11.0 is needed by secured_soft_2.0.0.rpm
init-logger >= 2.0.11.0 is needed by secured_soft_2.0.0.rpm
init-security >= 2.0.11.0 is needed by secured_soft_2.0.0.rpm
As i have specified we already have secured_soft_1.3.0.rpm installed and above dependencies are also available but of different version. So we need the to install above dependencies and also need the old version's of dependencies for the old rpm's to work
ex : secured_soft_2.0.0.rpm has libArt.so libSec.so and so on which are copied to /usr/lib
Similarly secured_soft_1.3.0.rpm also has libArt.so libSec.so and so on which are already available in /usr/lib
I tried to rename the so's but still iam not able to install.
Is it possible to change the location for these so's and get the things done Is there any way we can do it.
At the moment, iam stuck here and would need advice on this Appreciate any help on this.
回答1:
Since the programs use the same filenames, and you need to put them on the same machine, you might be able to move the older version to another directory tree and make it work there.
You can do this with many applications which do not have compiled-in pathnames.
For instance,
- install the older version (this sounds like where you are starting from)
- use
rpm -ql
for each of the packages containing unversioned executables, libraries and associated files. - use tar to capture an archive of those files, relative to
/usr
(but omitting directories not owned by the packages). - create a new directory, e.g.,
/usr/local/myapp
and untar the older version there. - update configuration files in the new location as needed
For applications such as this, I would run in a script that updates PATH
(and perhaps sets LD_LIBRARY_PATH
) to force the program to run from the new location. You can verify if this works using tools such as strace and lsof, i.e., by looking for the files that the program opens.
Once you have the older version working properly in the new location, you can uninstall its rpms and install the new version of the application.
Caveat: If the newer package is copied from a newer version of the operating system, however, the task is likely to be beyond your ability, whether or not you choose the alternative approach of recompiling the newer packages to fit on the existing system.
Building new/custom packages is one route to recompiling the newer version. If you have the source-RPMs for each part, that is a starting point:
- extract the files from the source-RPM, e.g., using a script such as
unrpm
(see for example HowTo: Extract an RPM Package Files Without Installing It), and - copy those extracted files to their as-expected locations in your build-tree, e.g.,
$HOME/rpmbuild/SOURCES
and$HOME/rpmbuild/SPECS
- modify the spec-file to use the alternative location
- build the new/modified package using the modified spec-file.
回答2:
No, out of the box, you cannot.
I'd highly recommend looking into Docker, where you can throw each one into their own container and let them take care of all their dependency problems.
来源:https://stackoverflow.com/questions/33255132/how-to-install-two-different-versions-of-same-rpm-and-make-them-work-parallely