While I tend to appreciate debian GNU/Linux, its tendency to be quite late on software versionning is sometimes annoying. Also, as a pkgsrc developer, I am used to have greater control over the packages I install, for example regarding the options I’d like to include.
For these reasons and a couple more, I sometimes choose to use pkgsrc along with
apt to deal with particular packages. In this article, I’ll show how to achieve that task.
First install build pre-requisite packages:
# apt-get install cvs libncurses5-dev gcc g++ zlib1g-dev zlib1g libssl-dev
Then fetch pkgsrc:
# cd /usr && cvs -d email@example.com.NetBSD.org:/cvsroot co pkgsrc
SH environment variable to
# export SH=/bin/bash
# cd /usr/pkgsrc/bootstrap # ./bootstrap
From now on, you’ll have a
/usr/pkg directory filled with necessary bits for building packages from
If you are to install services from
pkgsrc packages, you’ll have to copy NetBSD‘s
# wget -O/etc/rc.subr "http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/etc/rc.subr?rev=1.96&content-type=text/plain"
Create an ad-hoc
# mkdir /usr/pkg/etc/rc.d
Let’s say you’d like to install nginx out of
pkgsrc, possibly because debian‘s version is outdated or it does not contain your favorite module. Add the desired option to
pkgsrc's options file,
PKG_OPTIONS.nginx+= naxsi spdy
Build the software:
# cd /usr/pkgsrc/www/nginx # /usr/pkg/bin/bmake install clean clean-depends
Copy the startup script:
# cp /usr/pkg/share/examples/rc.d/nginx /usr/pkg/etc/rc.d/
Enable the service:
# echo "nginx=YES" >> /etc/rc.conf
And start it:
# /usr/pkg/etc/rc.d/nginx start
Now, how you integrate services start to your favorite
init system is up to you!