Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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