How to install program locally without sudo privileges?
Assume I have ssh access to some Ubuntu server as user and I need some not system tools to be installed for convenience (mc, rtorrent, mcedit). I do not want to bother admins for these small programs.
Is there a way to install them (make them run) without using something like
sudo apt-get install?
Possible duplicate of Is there any way to get APT to install packages to my home directory?
possible duplicate of Installation on debian 5 32-bit without being a root
Compile and install into
~/bin(and edit your
.bashrcto set the
PATHto include it). libraries can similarly be compiled and installed into
LD_LIBRARY_PATHto point to it), and development headers can be installed into e.g.
Depending on the specific details of the programs you want to install and the libraries they depend upon, you can download the .deb files and use '
dpkg-deb -x' to extract them underneath your home directory. You will then have a lot of "fun" setting the
LD_LIBRARY_PATH, and other
variables. The more complex the program or app you're installing the more fun you'll be up for :)
You will, of course, not be able to install
setuidbinaries this way - they'll install but (since you don't have permission to chown them to root or set the
setuidbit on them) they'll just be normal binaries owned by you.
Similarly, daemons and system services that expect to be running as a certain
UIDor have the ability to change uid, or expect files to be in
~/etcand so on aren't likely to work well, if at all.
Most sysadmins would consider
mceditto be "mostly harmless", innocuous programs.
Very few, however, would consider installing a torrent client to be harmless, especially if they have to pay for bandwidth or end up being legally liable. Most sysadmins would probably not be entirely happy for end-users to be installing such software without permission. They may say "sure, go ahead, knock yourself out" or they may not...but you should ask about anything that may cause problems for the owners/administrators of the machine.
I've heard that setting `LD_LIBRARY_PATH` is an evil hack. Does this apply here as well, or have I misunderstood?
All the issues with setting LD_LIBRARY_PATH apply. yes, it is, or can be, an evil hack. sometimes evil hacks are necessary to achieve particular goals...the crucial thing when breaking "rules" is to know them well enough to know what they're designed to save you from, and exactly why you need to break them in this particular case, and what the risks are or might be.
I just had to install an independent program (zoom), so first I tried the 2nd option (`dpkg-deb -x` to a local dir). Worked like a charm. I did not have to do any `LD_LIBRARY_PATH` hacks. Even if I have to, I would do it in the same command line so as not to affect the global settings (for example `$ LD_LIBRARY_PATH=/home/usr1/zoom/opt/zoom:/home/usr1/zoom/opt/zoom/zoom ZoomLauncher`).