2

I would like to install some programs on my work development server because it is missing some programs I need for my day to day job. I don't have root access.

What I did up to now is compiling the software I needs with option --prefix=/path/to/local/root. I then created a script that looks like that:

#!/bin/sh
export LOCAL_PATH="/path/to/local/root"
export LD_LIBRARY_PATH="$LOCAL_PATH/lib:$LOCAL_PATH/lib64:$LOCAL_PATH/lib64:$LD_LIBRARY_PATH"

binary=$(basename $0)
$LOCAL_PATH/bin/$binary "$@"

Then, if I create symlink to this program with the right name, it will run the local version. However, I have some issues:

  • The install folder might move from time to time. I happened recently and I had to reinstall everything
  • Some programs use libtool, which ignores the LD_LIBRARY_PATH when it finds a library in /usr/lib (which in my case was outdated)
  • The programs are hard to maintain or update

For the first two problems, it seems that creating a chroot would solve the problem. Would fakechroot help in that case ? Will my script still work ?

Also, the last issue makes me think about switching to a package manager. I was thinking about portage (from Gentoo, which I use at home), but maybe there are some more suited for my needs. Any suggestion? Maybe a lightweight Linux distribution ?

Finally, do I need to symlink /local/lib and /local/lib64 together ?

  • if you need these programs for your job, you should make the case to your sysadmin to install them globally on the server (using their package manager of choice). – Jeff Schaller Aug 21 '15 at 0:31
  • Actually, most of the programs are already there, but they are outdated (like gcc 4.3 or python 2.5 used to build the application) or not compiled with the right flags (vim without python flag). Also, my sysadmins already use shared directory to deploy programs across all the machine without installing them through the package manager as they have hundreds of machine to mange. And they can't answer to individual requests as this is a large company (I am one of the few using vim as my primary IDE, the official tool being Eclipse) – Nicop Aug 21 '15 at 0:39
  • You may want to ask a different approach to sysadmins using containers such as docker. – sebelk Aug 21 '15 at 12:02
  • We are moving to docker / openstack, but for deployment only. My company is very big and runs critical software that can't down more than a few seconds a year. All I need is some tools to improve my productivity on the development server (such as an up to date vim, the silver search, some python modules, gdb...). I also want the flexibility to install any software at any time without contacting the sysadmins, which don't answer to such requests unless it's critical for the whole team / company. – Nicop Aug 21 '15 at 19:33
  • You have crappy sysadmins then. If you can justify a need for the tools you need through a paper trail, then the sysadmins should update your tools, as the paper trail proves the criticallity. It's not this forums job to help you subvert security and your company's proper support channels. – eyoung100 Aug 26 '15 at 3:34
0

I am not sure whether it applies in your case - but I use graft.

It basically allows me to have a tree of installed packages in whatever place I want (e.g. $HOME/packages) and install symlinks to their files in whatever hierarchy I want (e.g under $HOME/local or /usr/local if I have root access). In effect, it helps you maintain a number of custom compiled packages (compiled just as you did, but with --prefix= /path/to/packages/foo-1.2.3 so they end up in a common place) - and you can even have multiple versions of the same package. You don't create the usual mess, because you get to choose which version to have active at any time:

$ cd $HOME/packages
$ ls 
mpv-git
texinfo-4.13
texinfo-git

$ graft -i texinfo-4.13
$ # symlinks now installed in my $HOME/local/bin, $HOME/local/lib, etc
$ # and since $HOME/local/bin is in my PATH, I now have texinfo-4.13
$
$ graft -d texinfo-4.13
$ # removed texinfo 4.13 symlinks - let's install bleeding edge version
$
$ graft -i texinfo-git

This can also be used to maintain the mess that is otherwise going to happen to your /usr/local even if you are root.

The idea of using symlinks for package management has been modernized again in some Linux distros - but I think graft can accommodate most use cases. It's a pity that only a few people know about it...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.