pkgsrc user FAQ
From NetBSD Wiki
General questions
My system already has Perl installed. Can pkgsrc use that, or why does it need its own version?
One of the main goals of pkgsrc is to do as few unexpected things as possible. When you install pkgsrc with --prefix=/usr/pkg, would you expect it to mess up your stuff in /usr/local? Or in /usr/bin? No? -- Good.
Using the system-provided Perl installation would require exactly this. Pkgsrc has lots of Perl modules, and it needs to install them somewhere. Installing them in /usr/pkg/lib/perl5 does not work because the system-provided Perl does not know about this directory and will not find the Perl modules. Installing the Perl modules into /usr/lib/perl5 would violate the goal of keeping pkgsrc completely in /usr/pkg.
So both ways do not work, and that's why pkgsrc has to install its own version of Perl.
Handling binary packages
To which (installed) package does the file xyz belong?
$ pkg_info -Fe /usr/pkg/bin/jpeg2ktopam netpbm-10.34
Notes:
- The file must be given with the absolute pathname.
- The order of the -Fe options is important.
Which files are in package xyz?
$ pkg_info -qL netpbm /usr/pkg/bin/411toppm /usr/pkg/bin/anytopnm /usr/pkg/bin/asciitopgm ...
I need file xyz, but I don't know which package provides it.
How can I get a list of all files in $LOCALBASE that don't belong to any package?
Question: I want to know which files are orphaned, meaning that even if deinstalled all packages, they would still remain there.
Answer: Template:TODO
How can I show the changes I made to the configuration files of a package?
Building packages from source
How can I switch off certain PKG_OPTIONS?
Question: A package has some options enabled by default, and I cannot switch them off in my mk.conf.
For example, mail/maildrop/Makefile says:
PKG_OPTIONS_VAR= PKG_OPTIONS.maildrop PKG_SUGGESTED_OPTIONS= authlib
In my mk.conf file, I tried the following:
PKG_OPTIONS.maildrop= #none
But "make show-options" still shows:
Any of the following general options may be selected:
authlib
These options are enabled by default:
authlib
These options are currently enabled:
authlib
You can select which build options to use by setting PKG_DEFAULT_OPTIONS
or PKG_OPTIONS.maildrop.
Answer: You can switch off that option by setting the following in your mk.conf:
PKG_OPTIONS.maildrop= -authlib
What does "ignoring invalid character `\001' in script" mean?
You seem to be using Ubuntu Linux, and your /bin/sh is a symlink to /bin/dash. That shell's echo command doesn't behave like the BSD variant: echo '\400' does not echo the characters '\\', '4', '0', '0', but instead only an '@' character. This is explicitly allowed by POSIX, but rarely any program expects this.
The work-around is to add the the line
TOOLS_PLATFORM.sh= /bin/bash
to your mk.conf file and rebuild devel/libtool-base. (You were getting this error message when compiling a package using libtool, weren't you? ;))
