LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-23-2011, 06:38 AM   #1
alexbrui
Member
 
Registered: Nov 2009
Location: Ukraine
Distribution: Slackware 13.37
Posts: 38

Rep: Reputation: 0
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
 
Old 09-23-2011, 06:57 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,130

Rep: Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202
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

Last edited by ponce; 09-23-2011 at 06:58 AM.
 
1 members found this post helpful.
Old 09-23-2011, 07:27 AM   #3
Bindestreck
Member
 
Registered: Jul 2011
Location: Sweden
Distribution: Slackware
Posts: 822

Rep: Reputation: 442Reputation: 442Reputation: 442Reputation: 442Reputation: 442
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 .
 
Old 09-23-2011, 09:14 AM   #4
ottavio
Member
 
Registered: Nov 2007
Posts: 312

Rep: Reputation: 46
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?
 
Old 09-23-2011, 09:44 AM   #5
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,130

Rep: Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202
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).

Last edited by ponce; 09-23-2011 at 09:46 AM.
 
Old 09-23-2011, 09:51 AM   #6
ottavio
Member
 
Registered: Nov 2007
Posts: 312

Rep: Reputation: 46
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?
 
Old 09-23-2011, 10:02 AM   #7
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,130

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

Last edited by ponce; 09-23-2011 at 10:06 AM.
 
Old 09-23-2011, 10:06 AM   #8
ottavio
Member
 
Registered: Nov 2007
Posts: 312

Rep: Reputation: 46
Quote:
Originally Posted by ponce View Post
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
 
Old 09-23-2011, 10:36 AM   #9
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,130

Rep: Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202
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.

Last edited by ponce; 09-23-2011 at 10:43 AM.
 
Old 09-23-2011, 10:52 AM   #10
alexbrui
Member
 
Registered: Nov 2009
Location: Ukraine
Distribution: Slackware 13.37
Posts: 38

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ponce View Post
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 View Post
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.
 
Old 09-23-2011, 11:07 AM   #11
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
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.
 
Old 09-23-2011, 01:07 PM   #12
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,130

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


Reply

Tags
packages, slackware



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Installing a package with "-S" and few versions available Mr. Alex Arch 4 11-24-2010 08:58 AM
Different versions package from different user piccir Linux - Software 1 06-06-2010 03:45 AM
Pinning package versions DaveQB Ubuntu 1 03-31-2007 09:48 AM
Package Dependencies on Old Versions (Newbie: Help Please!) bradleymorgan Linux - Software 2 04-02-2004 02:15 PM
does aaa_base package change over versions? rich442 Slackware - Installation 1 02-29-2004 11:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration