如何安装两个不同版本的相同 rpm 并使它们并行工作 [英] How to install two different versions of same rpm and make them work parallely

查看:175
本文介绍了如何安装两个不同版本的相同 rpm 并使它们并行工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在尝试安装 rpmsecured_soft_2.0.0.rpm 并且我是无法安装它,因为我们已经安装了secure_soft_1.3.0.

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.

复杂性:

这些包又具有依赖的 rpm(很多)以及所有这些相互依赖的 rpm 也有版本例如:secure_soft_1.3.0 仅适用于 1.3 版的软件包,和secured_soft_2.0.0.rpm 仅适用于版本 2.0 的依赖项.所以所有这些依赖项也需要重新安装,甚至这些依赖应该并行安装,不要删除旧的.

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.

最后,这两个版本都包含共享库,并且这些共享lib 的名称中没有版本号.

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  

正如我所指定的,我们已经安装了secure_soft_1.3.0.rpm 并且上述依赖项也可用,但版本不同.所以我们需要安装上面的依赖项,还需要旧版本的旧 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

例如:secure_soft_2.0.0.rpm 有 libArt.so libSec.so 等等复制到/usr/lib

ex : secured_soft_2.0.0.rpm has libArt.so libSec.so and so on which are copied to /usr/lib

同样secure_soft_1.3.0.rpm也有libArt.so libSec.so等等已经在/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

我尝试重命名 so,但仍然无法安装.

I tried to rename the so's but still iam not able to install.

是否可以更改这些so的位置并完成工作有什么办法可以做到.

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.

推荐答案

由于程序使用相同的文件名,并且您需要将它们放在同一台机器上,您可能能够移动将旧版本转移到另一个目录树并使其在那里工作.

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.

例如

  • 安装旧版本(这听起来像是您从哪里开始)
  • 对每个包含未版本控制的可执行文件、库和相关文件的包使用 rpm -ql.
  • 使用 tar 来捕获这些文件的存档,相对于 /usr(但省略 不是包拥有的目录).
  • 创建一个新目录,例如 /usr/local/myapp 并在那里解压旧版本.
  • 根据需要更新新位置中的配置文件
  • 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

对于诸如此类的应用程序,我将在更新 PATH(并可能设置 LD_LIBRARY_PATH)的脚本中运行,以强制程序从新位置运行.您可以使用诸如 stracelsof,即通过查找程序打开.

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.

一旦旧版本在新位置正常运行,您就可以卸载其 rpm 并安装新版本的应用程序.

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.

构建新的/自定义的包是重新编译新版本的一种途径.如果您有每个部分的源 RPM,这是一个起点:

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:

  • 从源 RPM 中提取文件,例如,使用诸如 unrpm 之类的脚本(参见例如 HowTo:在不安装的情况下提取 RPM 包文件),以及立>
  • 将这些提取的文件复制到构建树中的预期位置,例如 $HOME/rpmbuild/SOURCES$HOME/rpmbuild/SPECS
  • 修改规范文件以使用替代位置
  • 使用修改后的规范文件构建新的/修改过的包.
  • 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.

这篇关于如何安装两个不同版本的相同 rpm 并使它们并行工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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