[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can I use dpkg -i to install in /usr/local or /opt?

On Wed, Sep 27, 2000 at 05:42:28PM +0000, W. Borgert wrote:
> Hi,
> On Wed, Sep 27, 2000 at 08:45:42AM +0200, Ulf Jaenicke-Roessler wrote:
> > > dpkg --prefix=/usr/local (or /home/somebody or /opt) and the
> > > scripts inherit the environment variable DPKG_PREFIX from
> > > dpkg.  In the actual prerm script one has to write, e.g.
> > > 
> > >   install-info --quiet --remove $DPKG_PREFIX/info/foobar.info.gz
> > 
> > I doubt that this will ever happen. You might want to look at
> > http://kt.linuxcare.com/debian/dd20000907_1.epl
> > for some thoughts about a very similar issue.
> 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!


I don't think you understand all the issues here. Some of the more
important ones are:

You're asking about two different things: a) install as non-root,
and b) install in non-standard places.  These have differing problems.

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()).
* 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 
* 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.

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.

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

* (I know you mentioned this one) Some binaries are, for security
reasons, compiled in with hard-coded paths. Most documentation has
hard-coded paths.

In short, whilst I believe such a thing would be possible, and even
useful, it would be a huge task...


Reply to: