0

Earlier I tried installing chrome (from a .deb file) on Debian using a non root account. I couldn't do it. Is there any distro or tools that will allow me to install chrome from a deb file and get its dependencies?

  • 2
    Probably none. There are really good reasons to not allow this. However, there is a simple alternative, install things to `/usr/local`. It's a world-writable directory that's meant exactly for this purpose. – HalosGhost Dec 06 '14 at 14:30
  • As HalosGhost says, there are some important reasons why this should *not* be allowed. Namely, you are installing into system directories that are owned root. Making that possible would be a serious security risk, etc. If it is your machine and you don't care, then you can do it as root anyway. If it isn't and you can't, then there you are: sorry, no non-root installs to system paths. – goldilocks Dec 06 '14 at 16:16
  • @HalosGhost `/usr/local` is not world writeable nor should it be. Alternate versions of things can be installed there that override the normal ones, but since it is usually part of the default `$PATH`, no one but root should be allowed to do this. – goldilocks Dec 06 '14 at 16:20
  • @goldilocks, ahh, I must have misunderstood what someone else told me then (I've never used `/usr/local` since I've never had any reason to). Thanks for setting me right! – HalosGhost Dec 06 '14 at 16:22
  • @goldilocks: I'm completely confused. I asked for non root installation so I wouldn't have security risk –  Dec 07 '14 at 10:36
  • That's why this was closed as a duplicate of that other question. A non-root user *can't* install to the system, but you *can* install to your home directory. Unfortunately there are no package managers I know of that make this convenient, but that doesn't mean you can't do it. It's the only logical option *unless* you trust your friend enough to give that user sudo permission on `apt-get`. WRT you on other systems, then my first comment applies: someone has to allow you to install to the system. You can't just decide a way for yourself. – goldilocks Dec 07 '14 at 10:43
  • Put another way: there's no truly secure way to install to the system that doesn't entail the user take some responsibility for this security, which is why it requires root permission. – goldilocks Dec 07 '14 at 10:46

2 Answers2

0

If you are restricting your consideration to Debian-based distributions, as it appears you are, then note that dpkg will refuse to run neither of the following is true a) you are root, b) you have root privileges e.g. via sudo. Therefore, you cannot install a deb into the system in the normal way via a non-root account. You could try to work around it by manually copying the deb files into the system, and bypassing dpkg, but this is a really bad idea. So, in short, no.

Perhaps you could go into more detail about your use case? Why do you want to do something like this?

Faheem Mitha
  • 34,649
  • 32
  • 119
  • 183
  • Actually there is a flag called force-not-root. But I run into other problems like not being able to access dpkg status and missing files/binaries. ldconfig problems also came up. –  Dec 06 '14 at 12:50
  • @acidzombie24 dpkg `force` flags, like force flags in all sensibly designed software, are generally contra-indicated except under extraordinary circumstances. And in such situations, you really need to know what you are doing (read, expert). Again, why are you trying to do this? – Faheem Mitha Dec 06 '14 at 12:52
  • The use case is using a machine I dont have root access on or giving someone access to my machine w/o root access. I don't want their installs to touch anything of mine. Also I don't care what distro it doesnt need to be debian –  Dec 06 '14 at 12:52
  • @acidzombie24 Not clear what you mean. When you say "using a machine I dont have root access on or giving someone access to my machine w/o root access", are these two different situations? And what situation are you actually trying to deal with right now. I assume this is not a hypothetical. – Faheem Mitha Dec 06 '14 at 12:55
  • Its two different situations. I'm trying to install a program in a way that it doesn't touch anything on the system the user doesn't normally have access to. Another example could be a modified version of VLC from a 3rd party I dont trust –  Dec 06 '14 at 13:00
0

You need to use the "sudo" command which allows you to execute commands as the superuser or another user.

example:

sudo apt-get install lshw

You need to have your user authorized to use sudo though. check the /etc/sudoers file. Proper way to edit this file is using the "visudo" command.

visudo
Matías
  • 291
  • 2
  • 9
  • Sudo gives root permissions. I don't want any root access at all. –  Dec 06 '14 at 12:51
  • then you may want to download the package src, configure with an install path within your home dir, make, make install, PATH=$PATH:. Otherwise I guess you cannot manipulate the package management database so easily without root permissions. I've never tried, though. You need to proceed in this way because you cannot get root access? – Matías Dec 06 '14 at 12:55