Thursday, January 27, 2011

Installing software on Linux without root privileges

I find it extremely hard to install software on a Linux machine as a regular user. I don't have root privileges on this machine, so I can't use any package manager system.

For example I'm trying to install a simple IRC client, but installing everything from source is a pain because I have to manually download and install every single dependency on the tree (irssi->glib->ncurses etc.. etc..).

So I downloaded ircii which seems to be the most minimalistic client I can find, it still requires some program called lex which I can't find.

Any easy solutions for this hassling task? Why don't people just deliver binaries that have all I need included in them (sort of like .exes)?

  • Any easy solutions for this hassling task? Why don't people just deliver binaries that have all I need included in them (sort of like .exes)?
    

    At the risk of sounding the snarky, the way to do this is to either

    1. get root privileges
    2. have your sysadmin at your beck and call

    I'm assuming the machine you are working on isn't yours, otherwise #1 would be achievable. With that assumption said, if it's my machine that you are working on, I don't want you to be able to install new packages and libraries whenever you want and I want you to come to me to do this unless I really trust you. This is how linux distributions and linux administration is supposed to work.

    So... why people just don't deliver binaries? It's most likely due to linux (libraries) being much more module in nature and slightly more fragmented. There isn't a huge core api like win32 that a developer can assure will be there. They have to rely on the explicit libraries they need and specific versions of those libraries to be available at both compile time and runtime in order to successfully distribute their software. This is almost universally true. AFAIK, Windows has the same problem with all but the simplest of exes which just rely on core Windows libraries - you'd have to run an installer with Admin privileges to make registry modifications and install libraries. MacOSX is about the only OS out of the most well known 3 to cover the use case you are talking about, since all .app files are completely self contained and can be installed in a user's $HOME and work just fine.

    Luca Matteis : even linux binaries could be statically linked and distributed with all they need inside, just like .app
    jscott : @Luca: Yes, that's true. But .APPs *only* need to run on Macs -- a very tightly controlled platform. Maintainers probably wouldn't enjoy building their programs against every single architecture, lib version, gcc version, etc. Source is the "clean" way to distribute.
    Warner : If you statically compile a binary with a vulnerable or buggy library, updating the system library will not eliminate the binary without recompiling the software. The dynamic design is not a bad thing.
    From whaley
  • It is the way it should be, only administrators should administrate machines, and users should only use it.

    Anyway if you find a source package wich depends on software already installed you won't need to recompile it.

    There are also binaries for linux, but not so many. I recomend you to try to find programs created for interpreted languages. You will find a lot more and the requisite will be a java, python or perl interpreter.

    Check also if you have the ability to start wine, if you can, you could run a win32 executable, even install it.

    Luca Matteis : the fact that only admins can install software is a stupid argument since there's nothing stopping you from installing all the software that you want... it's just not as easy as using a package manager... and only admins have access to it
    theist : Only admins can install software. However any user can run software. Running make, auto-tools, gcc and all the tools to make an elf binary and running that binary its not installing software. You can download an exe to your desktop on that other OS and run from there, but that software isn't installed.
    theist : that reminded me wine, added to my answer.
    From theist
  • You might want to take a look at the Nix package manager. Not only is its whole approach to package management very interesting, but the website also claims that it works on every Linux distribution and allows non-privileged users to install software using it. You can find more information as well as a complete list of all available packages (ca. 2500) at http://nixos.org/nix/ .

    From
  • What about asking the system administrator to give you a sudo account? If properly configured can allow you only to execute some commands as a root user, such as the package manager, so you can install software without root credentials.

    From
  • You would think more people would remember multi-user systems and how it's often acceptable to run software from your home directory. Nevertheless, you should confirm it is okay with your host.

    If the system does not have the dependencies to compile from source and your administrator will not install them, your best options are as follows:

    • Locate a package compiled for the machine and extract the binary. (This may still fail without the dependencies.)
    • Locate a statically compiled binary for your system. Package or otherwise.
    • Statically compile on a similar machine and copy over
    From Warner
  • You could set up the same version of your Linux in a virtual machine and try building a static version of your app. Then you just transfer it to your home directory on the server and it shall run (assuming you can execute programs from your home directory, this is not always possible, sometimes /home lives on a filesystem mounted with noexec option for security reasons).

    From halp
  • It occurs to me that you probably have emacs installed, which means that you have a hosted "OS" with it's own package manager that you can use from user space.

    Package supports erc, and I am sure there are other emacs IRC clients.

    'Course, if you're not an emacs guy, this won't be what you want to hear.

    From dmckee

0 comments:

Post a Comment