LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Installing two versions of one package (http://www.linuxquestions.org/questions/slackware-14/installing-two-versions-of-one-package-904595/)

alexbrui 09-23-2011 07:38 AM

Installing two versions of one package
 
I need to install two versions of one package (GDAL library) in parallel. GDAL 1.8 is already installed and it used as default in my system (and many other programs compiled against it). Now I need to install GDAL 1.9 (development version) and then use it to compile and test some additional packages.

I want to leave GDAL 1.8 as my default and use GDAL 1.9 only to compile and testing of several programs. When I finish this work I also want to remove GDAL 1.9 in easy way.

Which is a best way to do this? I have all necessary SlackBuilds but don't know how to modify them to suite my requirements.

I'm running Slackware 13.1

ponce 09-23-2011 07:57 AM

the cleanest and less harmful, in my opinion, is to build and test on a virtual machine.

you can also install it in a non-standard place, passing a different --prefix (like, for example, --prefix=/opt/gdal) to the configure in the gdal.SlackBuild, but then, when you'll build other programs over that, you have to add the path of the non-standard installed libraries to LDFLAGS and LD_LIBRARY_PATH and specify the custom location of the new gdal headers.
then, to use the new libraries when running programs built against them, you will still need a custom LD_LIBRARY_PATH.

I think getting crazy with installing things in non-standard place, with many easy virtualization solutions around, is not worth the hassle, assumed also that you have to modify stuff again later to reinstall in the proper place ;)

Bindestreck 09-23-2011 08:27 AM

Yep, I can confirm what ponce is telling, which is a good advice. I am (was) the king in installing software manually in totally different locations with library in totally strange directories. In the end, my whole filesystem was a big cobweb with directories, until my computer totally failed, my Slackware could not even boot anymore. I think I have seen every possible error messages one can get in kernel boot messages, and more.

Then, I did format my hard drive and started freshly. Now, I always install in default locations with Slackware tools as sbopkg or src2pkg, and I dont have any annoying problems anymore.

So keep installing your software in /usr :).

ottavio 09-23-2011 10:14 AM

Can you install two versions of the same package in binary format? That is with installpkg?

If I rename the existing binary "/usr/bin/package.old" would the new "package" overwrite the old one?

ponce 09-23-2011 10:44 AM

a package of an application usually doesn't contain binaries only: you can verify the contents making a folder, cd'ing into it, and extracting the package with explodepkg.
you will find inside always the install scripts, the description and the docs; depending on the package there can be also man pages, /usr/share stuff, libraries, includes and other various files and folders (/var/*,/etc/* and so on).
you can rename the binary (and for ease of not losing it between all the others in /usr/bin, maybe move it in /usr/local/bin), but when you upgradepkg the original, all the other old components will be substituted by the new ones.
if you are sure the two versions don't overlap, use installpkg, it won't complain and will install it (but slackpkg will warn you at the next upgrade that you have two different versions of the same package installed - if in your opinion is safe, you can ignore that).

ottavio 09-23-2011 10:51 AM

What if I use :
installpkg -r newname package.tgz

What would actually happen? Would that create duplicate directories in /usr/bin, /usr/lib and so on?

ponce 09-23-2011 11:02 AM

sorry, what is "installpkg -r" supposed to do? last time I checked, it has no -r option.

ottavio 09-23-2011 11:06 AM

Quote:

Originally Posted by ponce (Post 4480219)
sorry, what's "installpkg -r"? it has no -r option.

-r Install the contents of the current directory and subdirectories as a package with the name you specify

It's on:
http://www.slackware.com/config/packages.php

ponce 09-23-2011 11:36 AM

maybe that is an old option (I never used it in the past so I don't even remember it), seems that's not in the present installpkg code: if you try exploding a package in a folder and use it with the supposed syntax
Code:

installpkg -r elviz
it replies
Code:

Cannot install -r: file not found
Cannot install elviz: file not found

you can rename the package before installpkg it (from elvis-2.2... to elviz-2.2..., for example) to have the same result, but if files/folders have the same name they will be simply overwritten and when you are going to removepkg one of the two, the files/folders named the same way won't be removed because they will be found in another package.

alexbrui 09-23-2011 11:52 AM

Quote:

Originally Posted by ponce (Post 4480095)
the cleanest and less harmful, in my opinion, is to build and test on a virtual machine.

I'm thought about this solution. But this will slowdown some operations like compiling.

Quote:

Originally Posted by ponce (Post 4480095)
you can also install it in a non-standard place, passing a different --prefix (like, for example, --prefix=/opt/gdal) to the configure in the gdal.SlackBuild, but then, when you'll build other programs over that, you have to add the path of the non-standard installed libraries to LDFLAGS and LD_LIBRARY_PATH and specify the custom location of the new gdal headers.
then, to use the new libraries when running programs built against them, you will still need a custom LD_LIBRARY_PATH.

This looks a bit easy, but I agree that this is not good to install in non-standard directories.
Anyway, thanks for all suggestions. I think, I'll try to setup virtual machine and run my test on it.

bgeddy 09-23-2011 12:07 PM

Quote:

-r Install the contents of the current directory and subdirectories as a package with the name you specify

It's on:
http://www.slackware.com/config/packages.php
I'm not sure how old those pages are but Slackware's installpkg hasn't had those options since Slackware 8.0 and maybe even older. Those pages badly need updating.

ponce 09-23-2011 02:07 PM

(shame on me) I read them today for the first time, but I really like those pages! they must be preserved in some way! :)


All times are GMT -5. The time now is 01:12 AM.