playing w/ pkgsrc

package list

for a router/gateway

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

    #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 https://os3.su/

and for a rather full-featured server environment, add

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

    #vim \

binaries

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 (libgssapi.so.10 not found).

uname -rpm

#export PASSIVE_FTP=yes
#export PKG_PATH="ftp://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.0/All/"
export PKG_PATH="http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.0/All/"

from source

setup your build env

vi /etc/mk.conf

MAKE_JOBS=8
ALLOW_VULNERABLE_PACKAGES=+nmap
X11_TYPE=modular
SSLBASE=/usr/local/ssl

grab the latest tarball

cd /usr/
ls -lhF | grep pkgsrc

ftp -a http://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz
nice progress -zf pkgsrc.tar.gz tar xf -

#gnu/linux
#wget http://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz
#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/
./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_JOBS=8 

make
make package
#make install

maintenance

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}'`
pkg_info
find /usr/pkg/
find /var/db/pkg/

the brutal way

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

troubelshooting

===> 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
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>

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

and then for alpine one gets

undefined reference to `tputs'

references


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