playing w/ pkgsrc

package list

for a router/gateway

echo $PKG_PATH
pkg_add \
    alpine \
    curl \
    iftop \
    iperf3 \
    mozilla-rootcerts \
    netcat \
    nmap \
    screen \
    trafshow \

    #tmux \
    #dsniff-nox11 \

as of today Apr 2019 glib2 dep is missing for dsniff, add it manually

cp -i /usr/share/examples/openssl/openssl.cnf /etc/openssl
ll /etc/openssl/certs/
mozilla-rootcerts install
ll /etc/openssl/certs/ca-certificates.crt
curl -I

and for a rather full-featured server environment, add

pkg_add \
    e2fsprogs \
    git \
    lftp \
    lynx \
    mc \

    #vim \


Do you want to use binary packages or build those from the pkgsrc tree?

If you want binary you may have to check online whether there are builds for the latest release yet, OR NOT.

To me, it looks like NOT only the MAJOR release version matters, but ALSO THE MINOR. For example mail/alpine did not run on NetBSD 7.1.2 although it was built for 7.0 ( not found).

uname -rpm

#export PASSIVE_FTP=yes
#export PKG_PATH=""
export PKG_PATH=""

from source

setup your build env

vi /etc/mk.conf


grab the latest tarball

cd /usr/
ls -lhF | grep pkgsrc

ftp -a
nice progress -zf pkgsrc.tar.gz tar xf -

#nice tar xzf pkgsrc.tar.gz

In case you are on gnu/linux or the pkgsrc-current tree is too recent compared to your NetBSD release

unset PKG_PATH
cd /usr/pkgsrc/bootstrap/

Fix a package’s deps by rebuilding it and look at your options

unset PKG_PATH
cd /usr/pkgsrc/mail/alpine/
cd /usr/pkgsrc/net/wget/
make show-depends
make show-options
make clean clean-depends
/usr/bin/make help topic=make_jobs

vi /etc/mk.conf #bootstrapped
vi /usr/pkg/etc/mk.conf #natural


make package
#make install


clean up the tree

find /usr/pkgsrc -name work -maxdepth 3 | xargs rm -rf

get rid of recently installed packages

ls -ltr /var/db/pkg/
ls -1tr /var/db/pkg/ | sed -rn '/py27-expat-2.7.16/,$p' | sed '$d'
pkg_delete `ls -1tr /var/db/pkg/ | sed -rn '/py27-expat-2.7.16/,$p' | sed '$d'`
ls -ltr /var/db/pkg/

start from scratch the soft way

echo `pkg_info | awk '{print $1}'`
pkg_delete `pkg_info | awk '{print $1}'`
find /usr/pkg/
find /var/db/pkg/

the brutal way

rm -rf /usr/pkg/
rm -rf /var/db/pkg/*


===> Building for gmake-4.2.1nb1
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /usr/pkgsrc/devel/gmake/work/make-4.2.1/config/missing aclocal-1.15 -I config
/usr/pkgsrc/devel/gmake/work/make-4.2.1/config/missing: aclocal-1.15: not found
WARNING: 'aclocal-1.15' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         '' or m4 files included by ''.
         The 'aclocal' program is part of the GNU Automake package:
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:

==> use binaries for automake autoconf gmake and build alpine and wget

and then for alpine one gets

undefined reference to `tputs'


Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml