git clone https://github.com/NetBSD/pkgsrc
cd bootstrap
SH=/bin/bash ./bootstrap --unprivileged --prefix ~/pkg_2020Q3_centos6 --make-jobs 4
pkgsrc.se - a searchable web index of pkgsrc
http://pkgsrc.se/
pkgsrc 是一個套件管理程式
最初發現 是由於機器學習的需求 需要安裝 fann2 函式庫
fann2 文件裡頭 提到 可以使用 pkgsrc 進行安裝
fann2
安裝 pkgsrc
我們依照
http://www.netbsd.org/docs/pkgsrc/getting.html#getting-first
的說明
到
http://ftp.NetBSD.org/pub/pkgsrc/
點選 current 進入
下載 pkgsrc.tar.gz
下載完解壓縮後 進行安裝
tar xf pkgsrc.tar.bz2
ls pkgsrc
archivers bootstrap converters devel emulators games inputmethod Makefile misc news pkgtools security textproc x11
audio cad cross distfiles filesystems geography lang math mk packages print shells time
benchmarks chat CVS doc finance graphics licenses mbone multimedia parallel README sysutils wm
biology comms databases editors fonts ham mail meta-pkgs net pkglocate regress templates www
cd pkgsrc/bootstrap
./bootstrap --unprivileged
$NetBSD: MESSAGE,v 1.6 2014/12/05 14:31:07 schmonz Exp $
You may wish to have the vulnerabilities file downloaded daily so that
it remains current. This may be done by adding an appropriate entry
to a user's crontab(5) entry. For example the entry
# download vulnerabilities file
0 3 * * * /home/dpuser/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities >/dev/null 2>&1
will update the vulnerability list every day at 3AM. You may wish to do
this more often than once a day.
In addition, you may wish to run the package audit from the daily
security script. This may be accomplished by adding the following
lines to /etc/security.local
if [ -x /home/dpuser/pkg/sbin/pkg_admin ]; then
/home/dpuser/pkg/sbin/pkg_admin audit
fi
Alternatively this can also be acomplished by adding an entry to a user's
crontab(5) file. e.g.:
# run audit-packages
0 3 * * * /home/dpuser/pkg/sbin/pkg_admin audit
Both pkg_admin subcommands can be run as as an unprivileged user,
as long as the user chosen has permission to read the pkgdb and to write
the pkg-vulnerabilities to /home/dpuser/pkg/pkgdb.
The behavior of pkg_admin and pkg_add can be customised with
pkg_install.conf. Please see pkg_install.conf(5) for details.
If you want to use GPG signature verification you will need to install
GnuPG and set the path for GPG appropriately in your pkg_install.conf.
===========================================================================
===> running: /bin/sh /home/dpuser/1121_pkg/usr/new/pkgsrc/bootstrap/work/bin/install-sh -d -o dpuser -g dpuser /home/dpuser/pkg/etc
===========================================================================
Please remember to add /home/dpuser/pkg/bin to your PATH environment variable
and /home/dpuser/pkg/man to your MANPATH environment variable, if necessary.
An example mk.conf file with the settings you provided to "bootstrap"
has been created for you. It can be found in:
/home/dpuser/pkg/etc/mk.conf
You can find extensive documentation of the NetBSD Packages Collection
in /home/dpuser/1121_pkg/usr/new/pkgsrc/doc/pkgsrc.txt.
Hopefully everything is now complete.
Thank you for using pkgsrc!
===========================================================================
===> bootstrap started: Mon Nov 21 16:30:25 CST 2016
===> bootstrap ended: Mon Nov 21 16:32:37 CST 2016
結束後 會在家目錄產生 pkg 目錄
設定路徑
export PATH=/home/dpuser/pkg/bin:$PATH
export MANPATH=/home/dpuser/pkg/man:$MANPATH
範例: 安裝 fann2
cd ${PKGSRCDIR}/devel/py-fann2
bmake install
範例: 安裝 tmux
cd misc/tmux # packages are organized by category
bmake install clean clean-depends # MUST use bmake, provided by pkgsrc, rather than GNU make on linux.
pkg_info
pkg_info -u # The -u flag does not list any dependencies.
pkg_delete -R tmux
Upgrade All Packages
cd ~/pkgsrc/pkgtools/pkg_rolling-replace
bmake install clean clean-depends
pkg_rolling-replace -u -n -v
pkg_rolling-replace -u -v
https://codeghar.com/blog/essential-pkgsrc-the-missing-mini-handbook.html
pkgsrc-2020Q2.tar.bz2
SH=/bin/bash ./bootstrap --unprivileged --prefix ~/pkg_2020Q3 --make-jobs 4 # 4m 2s
Please remember to add ~/008/pkg_2020Q3/bin to your PATH environment variable
editors/emacs26 (8h)
wm/icewm (3m 49s)
wm/openbox (3m)
x11/st-term (45m 31s)
devel/exctags (18s)
./exctags --version Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
bmake install clean clean-depends
bmake --help [-j max_jobs]
bmake -j$(nproc) install clean clean-depends ERROR: This package has set PKG_FAIL_REASON: ERROR: [bsd.pkg.mk] pkgsrc does not support parallel make for the infrastructure. ERROR: [bsd.pkg.mk] Run "bmake help topic=make_jobs" to get some parallelism.
cd cad/verilator
bmake install
# 29m 28s
bmake clean clean-depends
cd cad/verilator
MAKE_JOBS=13 bmake install
# 5m 16s
MAKE_JOBS determines the argument to make -j, i.e. the number of concurrent make threads, default 1.
https://github.com/joyent/pkgsrc.joyent.com/blob/master/docs/building/index.markdown
Packages should build reliably even with high MAKE_JOBS (and if not, MAKE_JOBS_SAFE=no should be set, conditioned by OS if the problem is only on one OS). http://www.pkgsrc.org/quarterly/
http://wiki.capricelinux.org/doku.php?id=hitchhiker_guide_pkgsrc nproc or nproc+1
Update package
cd /path/to/
bmake update
https://wiki.netbsd.org/pkgsrc/how_to_upgrade_packages/
Update pkgsrc system packages see https://www.dragonflybsd.org/docs/howtos/HowToPkgsrc/#index10h3
Remove package
bmake deinstall
pkg/sbin/pkg_info
pkg/sbin/pkg_delete -R tmux
export MANPATH=~/pkg/man:$MANPATH
man pkg_delete
https://www.dragonflybsd.org/docs/howtos/HowToPkgsrc/#index9h3
pkgin
cd pkgtools/pkgin
bmake install
find . -name 'repositories.conf'
./etc/pkgin/repositories.conf
./pkgdb.refcount/files/pretir/008/pp/p1/pkg/etc/pkgin/repositories.conf
echo 'https://pkgsrc.joyent.com/packages/Linux/el6/trunk/x86_64/All/' >> ./etc/pkgin/repositories.conf
pkgin update
pkgin list
pkgin autoremove
pkgin clean
pkgin show-deps foo
pkgin show-full-deps foo
pkgin search tmux
https://pkgin.net/ https://pkgsrc.joyent.com/install-on-linux/
---
https://uwm.edu/hpc/software-management/ http://mirror1.hpc.uwm.edu/pkgsrc/packages/sharedapps/pkg-2019Q4/RHEL7/All/ https://nullbuffer.com/2019/12/03/pkgsrc_linux.html https://pkgsrc.joyent.com/packages/Linux/el7/trunk/x86_64/All/ https://pkgsrc.joyent.com/packages/Linux/el6/trunk/x86_64/All/
git
git clone https://github.com/NetBSD/pkgsrc-wip
du -sh pkgsrc-wip
599M pkgsrc-wip
git clone https://github.com/NetBSD/pkgsrc
du -sh pkgsrc
2.2G pkgsrc
SH=/bin/bash ./bootstrap --unprivileged --prefix ~/pkg_git --make-jobs 4
(advanced; no history) git clone --depth 1 git://wip.pkgsrc.org/pkgsrc-wip.git wip
$ cd pkgsrc
$ find . -name 'mk.conf'
./mk/defaults/mk.conf
./bootstrap/work/mk.conf
$ cd ~/pkg
$ find . -name 'mk.conf'
./etc/mk.conf
Keep your env clean
Don't mess up your env (like mixing linuxbrew)
cc -c -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I~//.linuxbrew/include -D_LARGEFIL
E_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -I~/pkg/include -I/usr/include
-I~/pkg/include -DVERSION=\"1.07\" -DXS_VERSION=\"1.07\" -fPIC "-I~//.linuxbrew/Cellar/perl/5.32.0/lib/perl5/5
.32.0/x86_64-linux-thread-multi/CORE" gettext.c
gettext.xs:1:20: fatal error: EXTERN.h: No such file or directory
compilation terminated.
*** Error code 1
Stop.
bmake: stopped in ~/pkgsrc/devel/p5-gettext/work/Locale-gettext-1.07
*** Error code 1
Stop.
bmake: stopped in ~/pkgsrc/editors/emacs27
bmake
bmake bin-install clean
bmake show-options
bmake show-all-build | grep JOBS
You can select which build options to use by setting PKG_DEFAULT_OPTIONSor PKG_OPTIONS.nmap.
make PKG_OPTIONS.uim="qt -canna" install clean; make clean-depends.
https://wiki.netbsd.org/pkgsrc/how_to_use_pkg_options_with_pkgsrc/
$ vi /opt/local/etc/mk.conf
PKG_OPTIONS.nmap+= ndiff
https://www.perkin.org.uk/pages/pkgsrc-binary-packages-for-illumos.html
bmake stage-install
bmake PACKAGES=$HOME/b package
pkg_info -u lists all user-installed packages and not their dependencies
pkg_info -a shows all isntalled packages
man pkg_info
pkg_add /usr/pkgsrc/packages/All/clang-X.Y.Z.tgz
bmake stage-install
bmake PACKAGES=$HOME/b package
https://nullbuffer.com/2019/12/03/pkgsrc_linux.html https://www.perkin.org.uk/posts/pkgsrc-on-smartos-creating-new-packages.html
bin-install https://www.dragonflybsd.org/docs/howtos/HowToPkgsrc/#index3h2
https://wiki.netbsd.org/pkgsrc/intro_to_packaging/ The framework uses an mk.conf file, usually found in /etc. Here's how mine looks: BINPKG_SITES is the remote place where to get packages with the bin-install make target
LC_TYPE Unicode
export LC_CTYPE
LC_CTYPE="en_US.UTF-8"
export LC_COLLATE
LC_COLLATE="C"
export LC_TIME
LC_TIME="C"
export LC_NUMERIC
LC_NUMERIC="C"
export LC_MONETARY
LC_MONETARY="C"
export LC_MESSAGES
LC_MESSAGES="en_US.UTF-8"
export LC_ALL
LC_ALL=""
https://codeghar.com/blog/essential-pkgsrc-the-missing-mini-handbook.html
Reference
wget https://ftp.netbsd.org/pub/pkgsrc/pkgsrc-2016Q1/pkgsrc-2016Q1.tar.bz2 tar jxvf pkgsrc-2016Q1.tar.bz2
- SH=/bin/bash pkgsrc/bootstrap/bootstrap
- --unprivileged --prefix /home/ourapp/root --make-jobs 4