install mozilla without root permission

Peter Pentchev roam at
Fri Oct 3 02:39:07 PDT 2003

On Thu, Oct 02, 2003 at 10:26:10PM -0700, Will Kessler wrote:
> Hello,
> I am a poor unpriv'd user on a shared freebsd system which has no
> installed browser.
> I'd like to install mozilla but cannot secure root or even pseudo
> privs to do it using a package. Is there any way to just install it in
> my local home dir? I've also tried biulding from source, after
> building gtk and glib, but this fails due to other dependencies.

You cannot really install an already-built package into another
location: most often, the binaries, libraries, and other files in the
package will have hardwired (at compile time) references to paths to its
'usual' location (the one it was built for) - it may be hard and
time-consuming (and even impossible for the binaries and libraries) to
track down and change all those references, and make sure it's done

The most you can do is build the port - starting with all its
dependencies - instructing it to install into your home dir.  Although
I've never done this for Mozilla itself, I have indeed succeeded in
doing this for other ports, including their dependencies.  It is not a
very easy task, though :(

The way to go about it is to set several environment variables.
- the PREFIX variable specifies where a port is to be installed; point
  it at your home directory, and the ports system will create the ~/bin,
  ~/lib, ~/share, etc, directories needed;
- the LOCALBASE variable specifies where a port should look for the
  libraries and commands installed by its dependencies; if you want to
  build Mozilla's dependencies, too (if they are not installed on the
  system in the default /usr/local hierarchy), you may want to also
  point LOCALBASE to your home directory;
- the INSTALL_AS_USER variable instructs the ports collection to not
  attempt to perform the actual installation as root; set it to any
  value, 'yes' works fine :)
- the NO_PKG_REGISTER variable instructs the ports collection to not
  attempt to actually register the package in the package database used
  by the pkg_add/pkg_delete/pkg_info tools; set it to any value, 'yes'
  works fine :)
- the DISTDIR variable contains the location for the directory where the
  ports system downloads the source files for the installed packages;
  since you may not have permission to write to the default download
  directory, /usr/ports/distfiles/, you may want to set DISTDIR to, say,
- the WRKDIRPREFIX variable contains the location for a directory where
  the ports are actually extracted and compiled; since you may not have
  permission to write to the default directories - they are created in
  the ports tree itself, e.g. /usr/ports/www/mozilla/work/ and
  /usr/ports/devel/gmake/work/, you may want to set WRKDIRPREFIX to,
  say, $HOME/tmp/work/;
- the DEPENDS_TARGET variable controls the way a port's dependencies are
  built when needed; since Mozilla has a lot of big dependencies, and
  you may not want to keep all of their extracted/compiled sources
  around after they were successfully installed, you may want to change
  the default 'install' setting to 'install clean', so that the ports
  are cleaned up immediately after a successful installation;
- the LD_LIBRARY_PATH, while not specifically a ports variable, will
  have some bearing on your trying to build applications which link with
  libraries in non-standard locations.  You may want to set
  LD_LIBRARY_PATH to $LOCALBASE/lib (if using the settings proposed
  above, this will be the same as $HOME/lib).

Well, I warned you that it might not be simple and easy :)  Something
like the following usually works for me:

- for Bourne-family shells (sh, ksh, bash, zsh):

  export DISTDIR=$HOME/tmp/dist/ WRKDIRPREFIX=$HOME/tmp/work/
  export DEPENDS_TARGET='install clean' LD_LIBRARY_PATH=$LOCALBASE/lib

- for C-family shells (csh, tcsh):

  setenv PREFIX $HOME
  setenv INSTALL_AS_USER yes
  setenv NO_PKG_REGISTER yes
  setenv DISTDIR $HOME/tmp/dist
  setenv WRKDIRPREFIX $HOME/tmp/work
  setenv DEPENDS_TARGET 'install clean'

Then either use the system's ports tree in /usr/ports, or extract your
own copy in, say, $HOME/ports/ and set the PORTSDIR variable to point at
it (export PORTSDIR=$HOME/ports or setenv PORTSDIR $HOME/ports), change
to the www/mozilla port's directory (cd /usr/ports/www/mozilla/), and
try 'make clean all install' to see if it will work :)

Someday I'll try to organize this, as well as any feedback received from
people who have tried it and found it a bit lacking, and make it a part
of the FreeBSD Handbook's ports section.  Thus, it will be awesome if
you actually tried to follow these directions and told me if it works or
not, including the error messages in the latter case :)

> Normally I develop under solaris and linux, for which i can get
> executables that seem to run in their own dir, so i'm less familiar
> with freebsd (although pkg_add sounds a bit like pkgadd under
> solaris).

Unfortunately, as noted above, pkg_add only installs precompiled
packages, and you cannot easily do this into a different directory - not
for a port as complex as Mozilla anyway :(

> Any pointers/help appreciated!  Opera just doesn't cut the mustard, I
> really don't want to use any MSFT products,  and googling revealed few
> clues.

Well, pretty much your only chance is to build the beast yourself... and
be warned, it *is* a beast, it is enormous, it has a *lot* of big
dependencies, it will take both much time and much disk space to do
this.  Still, it might be worth a try :)

By the way, there are a couple of other browsers in the ports/www
category: Arena and Mosaic come to mind, although they might be a bit
simplistic, but there might be others that I just don't know about :)
If Mozilla turns out to be really hard to build this way, you might want
to try some of the simpler ones.


Peter Pentchev	roam at    roam at    roam at
PGP key:
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
When you are not looking at it, this sentence is in Spanish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-ports mailing list