Feedback

type to search

Installing two versions of a package

Asked by , Edited by Fernando C. Estrada [ Admin ]

Hello,

I want to install 2 versions of a package, as I need these 2 versions for several projects :

  • cmake 2.6 patch4
  • cmake 2.8
Today, I use dpkg -i to (re)install packages with the version I want to use.

How can I install these 2 packages versions definitely (I can play with my \$PATH or update-alternatives) ?

Regards,

Remi
or Cancel

6 answers

3

rhonda [ Editor ]

If the package doesn’t offer it on themself you can’t do it easily unfortunately. The suggestion to use chroots for the different version is the best approach you can go. I suggest the package schroot that will enable you to reuse your homedirectory content in a quite convenient and straight-forward way. 

NN comments
rhertzog
-

You should rather recommend schroot. dchroot is only there for compatibility with the old dchroot that used to be managed by the Debian System Administrators.

or Cancel
1

linulin [ Editor ]

Use good old and flexible method - installation from upstream source code. Most configuration/build scripts usually support --prefix argument. So, you can choose where to install.

The following is a matter of taste and particular use-case. For example, pass --prefix=/usr/local/pkgname-version option to ./configure. After the installation - add /usr/local/pkgname/bin into PATH; and later - switch between versions via "ln -fns /usr/local/pkgname-version /usr/local/pkgname".

cmake upstream even provides precompiled binaries wrapped into a shell script which accepts —prefix option.

NN comments
rverchere
-

Hi, the easiest way for that package is to use the cmake shell script, and then playing with my PATH. Thanks for your help!

or Cancel
0

marchino

You could try to extract the files in a directory and try to use them from that non-standard location. You may need to set LDLIBRARYPATH variable. Beware that this may not work for all packages because extract is just one step of the install process (no preinst script and no configuration).

Look at dpkg-deb -x.

or Cancel
0

joey [ Editor ]

It's possible, though somewhat involved, to use dpkg-repack --generate cmake, then modify the unpacked package so it has a different name and versioned files, and run dpkg-deb --build on it. Then the other version of cmake can be installed as usual.

But my advice would be that if cmake sometimes needs a specific version, file a bug and ask the maintainer to provide a package at that version.
or Cancel

Your answer

You need to join Debian to complete this action, click here to do so.