Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to know if it is possible to choose where a .deb file will be installed, or if it is possible to move it after the installation to another directory without troubles for the app.

I am asking that because I am running Ubuntu on a 32Go's SSD, and I would like to install some games from Humble Bundle on my other HDD.

share|improve this question
    
Possible duplicate: askubuntu.com/questions/156927/… –  user68186 Jan 4 '13 at 14:41
    
There is a similar question also at superuser.com answering that question: superuser.com/questions/155537/… –  lumbric Jan 4 '13 at 14:42
    
I'm sorry, I've not checked SuperUser for this question. I thought it was something pretty specific to the operating system and it was the right place to search/ask it. But thanks for the answers. –  Kom Jan 5 '13 at 10:49
add comment

2 Answers

up vote 2 down vote accepted

There is a similar Q&A at superuser.com dealing with that question. A more specific question was asked also here at askubuntu.com.

Your choices are:

  • Use symlinks. Open the *.deb package with the archive manager. This tells you where the files go. Move those directories to your external harddisc and put a symlink at the origin. Be careful to move only directories from your games and not shared libraries or so!

  • Mount your external hardrive or some of its folders (a second time) at the game's path. E.g. /usr/share/games might be good candidate for your external harddisc. You can use the bind option, e.g.:

    sudo mount --bind /media/external-hardisc/usr-share-games /usr/share/games

  • Don't use a *.deb package, but install directly from source to a directory of your choice.

  • Use the dpkg paramter --root to change the install location. The man page says:

    --root=dir Changing root changes instdir to dir and admindir to dir/var/lib/dpkg.

    There is no guarantee that this will work. The program might not be able to deal with the different location.

(This list of solutions is not exhaustive.)

share|improve this answer
add comment

As I know extracted files like libraries and executables must be extracted into fixed directories that use these files during program execution. Also I think this debs contains large resources and lightweight files separately. For example many games unpack their resources to /opt directory. You can mount your HDD as /opt that store resources there:

Here is example:

sudo mv /opt /media/your_hdd/opt
sudo mkdir /opt

And check mount:

sudo mount --bind /media/your_hdd/opt /opt

if this works add mount --bind /media/your_hdd/opt /opt to /etc/rc.local before exit 0 to auto mount after each system boot.

share|improve this answer
add comment

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.