Bootstrapping Pkgsrc

Before installing packages from source or from binary, it is necessary to bootstrap pkgsrc. This is neccessary in order to build the tools that pkgsrc requires which are not a part of the Hitch Hiker base system.

cd /usr/pkgsrc/bootstrap
./bootstrap

Once this is done it is necessary to either reload the shell startup files or log out and back in again, in order to add /usr/pkg/bin and /usr/pkg/sbin to our $PATH.

exec zsh --login

As a final step, it is neccessary to add /usr/pkg/lib to the default linker path. This path is configured in /etc/ld.so.conf and can be extended with files placed in /etc/ld.so.conf.d. Finally, after configuring the linker paths, we run ldconfig to update the linker's cache of shared libraries.

install -d /etc/ld.so.conf.d
echo '/usr/pkg/lib' > /etc/ld.so.conf.d/pkgsrc.conf
ldconfig

NOTE:

Ordinarily the preceding command would be run as the root user. It is, however, possible to install packages as an unprivileged user by first making the package prefix directory writable by that user. In the case of a normal installation this would entail creating /usr/pkg and transferring ownership of it using the chown command before bootstrapping pkgsrc. It is also possible to bootstrap pkgsrc in one's own home directory. However, as this will break compatability with any provided binary packages it is therefore discouraged.