1

I'm entering an AI competition at school, and they give us each ssh access into a machine to set up our environments. I naturally do not have root access on this machine, but I want to install my own environment.

So then, is there any way that I install the packages I need in my home directory using apt-get? Or do I have to build everything from source?

3 Answers 3

3

I think your best bet is still compiling from source. It may be painful, but at least you know it will (or at least should) work.

You could also use dpkg as mentioned by grawity or dpkg -x to extract the contents of your packages, but it probably depends on what you're trying to install this way. Some things may work out of the box, some may not.

You can also look at a similar question at askubuntu for further reference.

It would help if you've mentioned what packages in particular you want in your environment. I suppose if you mention a programming competition, then you need development tools. Normally they are quite portable, so this should be doable.

2

dpkg normally requires root access. You could try dpkg --root ~ --force-not-root -i foo.deb on a package file.

0

I've made this little script for myself. Maybe you'll find it useful with some modifications.

#!/bin/sh
set -e

[ $# -ne 2 ] && echo "usage: $0 <pkgname> <destdir>" && exit 1

basedir=$2
aptitude download $1

for f in $1*.deb; do
  dpkg-deb -x $f $basedir
  rm $f
done

This, of course, won't work well with packages depending on other packages. In rare cases you could get away with unpacking all the needed packages inside the same directory.

NOTE: I use this inside ~/pkg where I have nothing else. In general, deleting everything matching $1*.deb isn't the greatest idea.

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.