Posting to this old question as it may help others.
There doesn't seem to be any option on apt-get for this. But there is for dpkg!
(Untested as I'm doing this from memory. This DOES NOT WORK for packages that install stuff in weird places.)
First download the .deb package using "sudo apt-get download chocolate-doom
"
Then run sudo dpkg -i --instdir=/home/YOURUSERNAMEHERE/YOURTARGETDIRECTORYHERE chocolate-doom_2.0.0-2_amd64.deb
(or whatever your .deb is called)
As a bonus, if you want to be able to run the program from anywhere in your shell, you can edit the file "/home/YOURUSERNAME/.bashrc"
and add export PATH=$PATH:$HOME/YOURTAGETDIRECTORYHERE
to the end of the file.
See https://help.ubuntu.com/community/HomeFolder#Installing_Software_Into_The_Home_Directory for details.
Usually people install stuff in /home/USERNAME/bin
and so you'd add "export PATH=$PATH:$HOME/bin
" to the end of your .bashrc file.
And run sudo dpkg -i --instdir=/home/YOURUSERNAMEHERE/bin chocolate-doom_2.0.0-2_amd64.deb
WARNING. Using the following incorrectly (or even correctly) will probably destroy your system.
The man page for dpkg also has a --admindir=
flag that, quote: "Change default administrative directory, which contains many files that give information about status of installed or uninstalled packages, etc. (Defaults to /var/lib/dpkg)"
So in theory, if dpkg is complaining about package conflicts and dependencies, you can use the above to build a completely separate dependency tree, containing required libraries that would otherwise conflict with your system's main libraries and dependencies. (Do not use --admindir=YOURDIR without --installdir=YOURDIR. It'll mess things up)
(Note. I have not tested this and if you do this in the wrong directory, you WILL override important files, and you WILL destroy your system. Also look at the --root=dir
option in the dpkg manual page. It's probably safer than using --admindir=YOURDIR and --installdir=YOURDIR together and risk accidentally forgetting one of them, or pointing one of them to the wrong dir etc.)
/usr/share/flightgear/
off you SSD, onto your HDD, and then right click on it, and press 'Make Link'. You can then copy that folder to/usr/share/
, rename it to flightgear, and hope it works. :-)