Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 25th July 2011
sharris sharris is offline
Package Pilot
Join Date: Jun 2010
Posts: 146
Default pkg_add --PREFIX ?

I just started using pkg_add but it default to storing everything in /usr/local and that been fine so far.

Now for certain programs I want them to be installed into a difference directory named /usr/local_1.

I read pkg_add (1) but the part about prefix is not sinking in and I have not yet found a single example in action anywhere while googing.

Is there a command that can easily do this, like ..

#: pkg_add - -install to -> /usr/local_1/ netbeans
If not, is there any other way to accomplish this task.

Thanks in advance
Reply With Quote
  #2   (View Single Post)  
Old 25th July 2011
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin Tournoij
Tcpdump Spy
Join Date: Apr 2008
Location: Ireland
Posts: 2,245

You can use -P, from pkg_add(1)

     -p, --prefix prefix
             Set prefix as the directory in which to extract files from a
             package.  If a package has set its default directory, it will be
             overridden by this flag.  Note that only the first @cwd directive
             will be replaced, since pkg_add has no way of knowing which
             directory settings are relative and which are absolute.  It is
             rare in any case to see more than one directory transition made,
             but when such does happen and you wish to have control over *all*
             directory transitions, then you may then wish to look into the
             use of MASTER and SLAVE modes (see the -M and -S options).  If
             the -p flag appears after any -P flag on the command line, it
             overrides its effect, causing pkg_add not to use the given prefix

     -P prefix
             Does the same as the -p option, except that the given prefix is
             also used recursively for the dependency packages, if any.  If
             the -P flag appears after any -p flag on the command line, it
             overrides its effect, causing pkg_add to use the given prefix
Note the difference between small -p and capital -P.

[~]# pkg_add -fP/tmp/test/ pciids-20101124.tbz

[/tmp/test]% find . -type f
Note that PREFIX is defined at compile-time. Depending on the application, it may or may not run from another directory...
Reply With Quote
  #3   (View Single Post)  
Old 25th July 2011
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
Join Date: May 2008
Posts: 696

If you want to install apps into a different PREFIX and guarantee that it will work, you definitely want to use the ports tree and not pre-compiled binary packages.

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox35 pkg_add interupted. jjjustjjjay OpenBSD Packages and Ports 2 2nd March 2010 03:43 AM
My version of pkg_add :) DNAeon FreeBSD Ports and Packages 26 15th October 2008 06:58 AM
pkg_add g95;g95 x.f95: cannot find g95 enpey OpenBSD Packages and Ports 8 27th August 2008 12:48 AM
pkg_add error buba OpenBSD Packages and Ports 4 13th June 2008 03:29 PM
cvs-supfile default prefix maxrussell FreeBSD General 2 24th May 2008 10:49 AM

All times are GMT. The time now is 02:41 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick