Re: Can I use dpkg -i to install in /usr/local or /opt?
Hi,
On Thu, Sep 28, 2000 at 11:55:46AM +0100, Jules Bean wrote:
> On Wed, Sep 27, 2000 at 05:42:28PM +0000, W. Borgert wrote:
> > Thanks, I read it but I still don't understand it. It is clear
> > for me that Debian does not place any files under /usr/local/.
> > My proposal was not to change this! If we say, only the sysadmin
> > is allowed to put files under /usr/local/, do we also say she
> > isn't allowed to use advanced tools to place files there? But
> > if we allow the sysadmin to put files under /usr/local/ using
> > advanced tools, why shouldn't it be dpkg. Note: As I wrote in
> > my other mail, I think the /var/lib/dpkg database should not be
> > involved, if files under non-standard directories are placed!
...
> Install as non-root has (at least) the following hurdles to cross:
>
> * All file ownerships will be broken. Only root can untar something
> and have it preserve correct permissions (only root can call chown()).
This is for most software packages (e.g. tools, utilities) no
problem at all. Software, where this would be a problem is
just to be installed local, that's bad luck. I don't expect
every software to work that way.
> * Only root can write to the dpkg database. It might be feasible to
> store per-user databases as well, if this idea were taken to a logical
> conclusion.
This was my proposal: Local or user-related installs should have
their own databases. It would be chaos to use the global one.
> * Most (nearly all?) {pre,post}{rm,inst} scripts assume they are
> running as root, and what they try to do will not work as non-root.
See below.
> In short, you lose many of the persuasive advantages of using dpkg. I
> could just about see the advantages of still being able to
> install/deinstall automatically, but I feel this would require
> 'custom' packages which know they are intended to be installed by
> non-root users.
It would require a new field in debian/control, e.g.
Allow-local: Yes or whatever, and the {post,pre}{inst,rm}
scripts of these packages have to take care of the
$DPKG_PREFIX environment variable as set by dpkg or sth.
similar.
> Install in non-standard places:
>
> * How do you map the paths? A typical package might keep files in
> /usr/bin, /usr/lib/<packagename>, /usr/lib, /usr/share/sounds,
> /var/lib/<packagename>, /etc, and so on. To say nothing of packages
> which install files in other package's trees because they are meant to
> interoperate with them (XFree modules installing in XFree's lib dir,
> packages installing menu entries in /usr/lib/menu, cron tasks in
> /etc/cron.d)
Yes, that's non-trivial.
> In short, whilst I believe such a thing would be possible, and even
> useful, it would be a huge task...
Yes, maybe it's just not worth the effort. There are so
many good ideas how to improve apt and dpkg - this is not
the most important one.
Cheers,
--
W. Borgert <debacle@debian.org>
Reply to: