Notebook

これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。

HTML ファイル生成日時: 2024/12/23 15:49:04.419 (台灣標準時)

NetBSD でバイナリーパッケージを利用する方法

NetBSD では、 pkgsrc を使って簡便にソフトウェアをコンパイルし、インス トールすることが可能でござる。なれど、 Raspberry Pi など、演算性能がそ れほど高くないハードウェアを使っている場合には、 Firefox などの大規模 なソフトウェアを pkgsrc を使ってインストールしようとする場合、数日の時 間を要することもあるでござる。そのような場合、コンパイル済みのバイナリー パッケージをインストールすると便利でござる。以下に、 NetBSD でバイナリー パッケージを利用するための方法を記録しておくでござる。

pkgin のインストール

バイナリーパッケージのインストールのためには、 pkgin というコマンドが 必要でござる。まずは、 pkgsrc を使って pkgin をインストールするでござ る。


# cd /usr/pkgsrc/pkgtools/pkgin
# ls -lF
total 24
drwxr-xr-x  2 root  wheel   512 Jan 19 10:16 CVS/
-rw-r--r--  1 root  wheel   218 Jun  8  2009 DESCR
-rw-r--r--  1 root  wheel  2340 Nov 28 09:24 Makefile
-rw-r--r--  1 root  wheel   182 Oct  6  2020 PLIST
-rw-r--r--  1 root  wheel   362 Nov 14 11:41 distinfo
-rw-r--r--  1 root  wheel   620 Oct 17  2021 options.mk
# make install

.....

=> Automatic manual page handling
=> Generating post-install file lists
=> Checking file-check results for pkgin-22.10.0nb1
=> Creating binary package /data0/netbsd/pkgsrc/current/pkgsrc/pkgtools/pkgin/work/.packages/pkgin-22.10.0nb1.tgz
===> Building binary package for pkgin-22.10.0nb1
=> Creating binary package /tmp/packages/All/pkgin-22.10.0nb1.tgz
===> Installing binary package of pkgin-22.10.0nb1
pkgin-22.10.0nb1: copying /usr/pkg/share/examples/pkgin/repositories.conf.example to /usr/pkg/etc/pkgin/repositories.conf

repositories.conf の編集

バイナリーパッケージの取得先を設定するために、 repositories.conf を編 集する必要があるでござる。まずは、雛形のファイルの内容を確認するでござ る。


# tail /usr/pkg/etc/pkgin/repositories.conf
#
# Remote http repository
#
# http://mirror-master.dragonflybsd.org/packages/$arch/DragonFly-$osrelease/stable/All
#
# Local repository (must contain a pkg_summary.gz or bz2)
#
# file:///usr/pkgsrc/packages/All
# NetBSD OS release can look like 6.0_STABLE, do not use it as-is
https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$arch/9.99.107/All

最後の行を変更すればよいようでござる。


# cd /usr/pkg/etc/pkgin
# ls -lF
total 8
-rw-r--r--  1 root  wheel  853 Jan 19 12:05 repositories.conf
# cp -pi repositories.conf repositories.conf.orig
# ls -lF
total 16
-rw-r--r--  1 root  wheel  853 Jan 19 12:05 repositories.conf
-rw-r--r--  1 root  wheel  853 Jan 19 12:05 repositories.conf.orig
# vi repositories.conf
# ls -lF
total 16
-rw-r--r--  1 root  wheel  921 Jan 19 13:32 repositories.conf
-rw-r--r--  1 root  wheel  853 Jan 19 12:05 repositories.conf.orig
# diff -c repositories.conf*
*** repositories.conf   Thu Jan 19 13:32:48 2023
--- repositories.conf.orig      Thu Jan 19 12:05:49 2023
***************
*** 23,27 ****
  #
  # file:///usr/pkgsrc/packages/All
  # NetBSD OS release can look like 6.0_STABLE, do not use it as-is
! #https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$arch/9.99.107/All
! http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/aarch64/10.0/All/
--- 23,26 ----
  #
  # file:///usr/pkgsrc/packages/All
  # NetBSD OS release can look like 6.0_STABLE, do not use it as-is
! https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$arch/9.99.107/All

データベースの作成

pkgin コマンドを使ってデータベースを作成するでござる。


# pkgin update
reading local summary...
processing local summary...
processing remote summary (http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/aarch64/10.0/All/)...
pkg_summary.bz2                               100% 3571KB 188.0KB/s   00:19    

pkgin コマンドを使ってパッケージを探す

準備ができたので、 pkgin コマンドを使って利用可能なパッケージを探して みるでござる。ここでは Firefox を探すことにするでござる。


# pkgin search firefox
fira-4.202           Mozilla's font for Firefox OS
firefox-104.0.2nb1   Web browser with support for extensions (version 104)
firefox-esr-102      Meta-package for installing the most recent Firefox ESR version
firefox-l10n-104.0.2  Language packs for www/firefox
firefox102-102.4.0   Web browser with support for extensions (version 102ESR)
firefox102-l10n-102.4.0  Language packs for www/firefox (version 102)
firefox91-91.13.0nb1  Web browser with support for extensions (version 91ESR)
firefox91-l10n-91.13.0  Language packs for www/firefox (version 91)
firefox_decrypt-0.7.0nb2  Extract passwords from Mozilla Firefox profiles
lz4json-0.0.20160401  Unpack lz4json files as generated by Firefox's bookmark backups

=: package is installed and up-to-date
<: package is installed but newer version is available
>: installed package has a greater version than available package

コンパイル済みバイナリーパッケージのインストール

pkgin コマンドを使って、 firefox102-102.4.0 を実際にインストールしてみるでござる。


# pkgin install firefox102-102.4.0
calculating dependencies...done.

68 packages to install:
  firefox102-102.4.0 pciutils-3.8.0 nss-3.83 nspr-4.35 libwebp-1.2.4
  libv4l-1.22.1 libffi-3.4.2nb3 libIDL-0.8.14nb6 icu-71.1
  hicolor-icon-theme-0.17nb1 gtk3+-3.24.34nb2 ffmpeg5-5.1.1nb1
  dbus-glib-0.112nb1 dbus-1.14.0nb3 xvidcore-1.3.7 x265-3.5
  x264-devel-20191217nb3 speex-1.2.1 libxml2-2.9.14 libvpx-1.12.0
  libvorbis-1.3.7 libva-2.15.0 libtheora-1.1.1nb2 libopus-1.3.1 libbluray-1.3.2
  libass-0.16.0 libaom-3.4.0 lame-3.100nb4 gnutls-3.7.7 dav1d-1.0.0
  wayland-protocols-1.26nb1 wayland-1.21.0 shared-mime-info-1.10nb6
  pango-1.50.8 libxkbcommon-1.4.1 libcups-2.4.2nb1 gdk-pixbuf2-2.42.9
  fribidi-1.0.11 cairo-gobject-1.16.0nb6 cairo-1.16.0nb6 atk-2.36.0nb1
  at-spi2-atk-2.38.0nb1 glib2-2.72.3 tiff-4.4.0 png-1.6.37nb1 jpeg-9e
  giflib-5.2.1nb4 jbigkit-2.1nb1 pcre-8.45 at-spi2-core-2.40.3nb2 lzo-2.10
  libpaper-1.1.28 graphite2-1.3.14 libxslt-1.1.34nb10
  libepoll-shim-0.0.20210418nb2 p11-kit-0.24.1 nettle-3.8.1
  mozilla-rootcerts-1.0.20220614 libunistring-1.0 libtasn1-4.19.0 libcfg+-0.7.0
  gmp-6.2.1nb3 harfbuzz-5.1.0 enca-1.15 xmlcatmgr-2.2nb1 libogg-1.3.5nb1
  libgcrypt-1.10.1 libgpg-error-1.45

0 to refresh, 0 to upgrade, 68 to install
213M to download, 665M to install

proceed ? [Y/n] 

「合計 213 MB のファイルをダウンロードすることになるでござるが、それで よろしいか」と尋ねられているので、それに y と答え、作業を続行するでご ざる。

proceed ? [Y/n] y
libgpg-error-1.45.tgz                         100%  450KB 450.2KB/s   00:01    
libgcrypt-1.10.1.tgz                          100% 1210KB   1.2MB/s   00:00    
jbigkit-2.1nb1.tgz                            100%  106KB 106.4KB/s   00:00    
pcre-8.45.tgz                                 100% 1202KB   1.2MB/s   00:01    
at-spi2-core-2.40.3nb2.tgz                    100%  293KB 292.9KB/s   00:01    
lzo-2.10.tgz                                  100%  152KB 151.7KB/s   00:00    
libpaper-1.1.28.tgz                           100%   27KB  26.9KB/s   00:00    
graphite2-1.3.14.tgz                          100%   98KB  98.5KB/s   00:00    
libxslt-1.1.34nb10.tgz                        100%  708KB 708.4KB/s   00:01    
libepoll-shim-0.0.20210418nb2.tgz             100%   26KB  26.4KB/s   00:00    
p11-kit-0.24.1.tgz                            100% 9411KB   1.8MB/s   00:05    
nettle-3.8.1.tgz                              100%   11MB   2.3MB/s   00:05    
mozilla-rootcerts-1.0.20220614.tgz            100%  624KB 623.8KB/s   00:01    
libunistring-1.0.tgz                          100% 1634KB 544.8KB/s   00:03    
libtasn1-4.19.0.tgz                           100%  148KB 147.9KB/s   00:01    
libcfg+-0.7.0.tgz                             100%  164KB 164.2KB/s   00:00    
gmp-6.2.1nb3.tgz                              100%  776KB 776.0KB/s   00:00    
harfbuzz-5.1.0.tgz                            100% 1644KB 821.8KB/s   00:02    
enca-1.15.tgz                                 100%  194KB 194.0KB/s   00:01    
xmlcatmgr-2.2nb1.tgz                          100%   30KB  30.3KB/s   00:00    
libogg-1.3.5nb1.tgz                           100%  228KB 228.1KB/s   00:00    
dbus-1.14.0nb3.tgz                            100%  808KB 807.9KB/s   00:01    
xvidcore-1.3.7.tgz                            100%  449KB 449.3KB/s   00:01    
x265-3.5.tgz                                  100% 1146KB 573.0KB/s   00:02    
x264-devel-20191217nb3.tgz                    100% 2186KB   2.1MB/s   00:01    
speex-1.2.1.tgz                               100%  552KB 552.4KB/s   00:00    
libxml2-2.9.14.tgz                            100% 2360KB   1.2MB/s   00:02    
libvpx-1.12.0.tgz                             100% 2525KB   1.2MB/s   00:02    
libvorbis-1.3.7.tgz                           100%  624KB 624.4KB/s   00:00    
libva-2.15.0.tgz                              100%  311KB 311.0KB/s   00:00    
libtheora-1.1.1nb2.tgz                        100%  716KB 715.9KB/s   00:00    
libopus-1.3.1.tgz                             100%  491KB 490.7KB/s   00:01    
libbluray-1.3.2.tgz                           100%  367KB 367.5KB/s   00:01    
libass-0.16.0.tgz                             100%  226KB 225.6KB/s   00:01    
libaom-3.4.0.tgz                              100% 3801KB 950.2KB/s   00:04    
lame-3.100nb4.tgz                             100%  584KB 584.4KB/s   00:00    
gnutls-3.7.7.tgz                              100% 4132KB   1.0MB/s   00:04    
dav1d-1.0.0.tgz                               100%  428KB 428.2KB/s   00:00    
wayland-protocols-1.26nb1.tgz                 100%   98KB  97.9KB/s   00:00    
wayland-1.21.0.tgz                            100%  219KB 219.0KB/s   00:00    
shared-mime-info-1.10nb6.tgz                  100% 1098KB 549.2KB/s   00:02    
pango-1.50.8.tgz                              100%  556KB 556.1KB/s   00:01    
libxkbcommon-1.4.1.tgz                        100%  261KB 260.8KB/s   00:01    
libcups-2.4.2nb1.tgz                          100%  989KB 989.1KB/s   00:01    
gdk-pixbuf2-2.42.9.tgz                        100%  781KB 781.3KB/s   00:01    
fribidi-1.0.11.tgz                            100%   89KB  89.0KB/s   00:00    
cairo-gobject-1.16.0nb6.tgz                   100%   26KB  26.4KB/s   00:00    
cairo-1.16.0nb6.tgz                           100% 1850KB 925.0KB/s   00:02    
atk-2.36.0nb1.tgz                             100%  451KB 450.9KB/s   00:01    
at-spi2-atk-2.38.0nb1.tgz                     100%   84KB  83.5KB/s   00:00    
glib2-2.72.3.tgz                              100% 4811KB   2.4MB/s   00:02    
tiff-4.4.0.tgz                                100% 1194KB   1.2MB/s   00:01    
png-1.6.37nb1.tgz                             100%  398KB 398.3KB/s   00:00    
jpeg-9e.tgz                                   100%  468KB 468.1KB/s   00:00    
giflib-5.2.1nb4.tgz                           100%   44KB  44.1KB/s   00:00    
pciutils-3.8.0.tgz                            100%  407KB 406.7KB/s   00:00    
nss-3.83.tgz                                  100% 3549KB   1.7MB/s   00:02    
nspr-4.35.tgz                                 100%  404KB 403.9KB/s   00:00    
libwebp-1.2.4.tgz                             100%  824KB 823.9KB/s   00:01    
libv4l-1.22.1.tgz                             100%  267KB 266.8KB/s   00:00    
libffi-3.4.2nb3.tgz                           100%   38KB  37.6KB/s   00:01    
libIDL-0.8.14nb6.tgz                          100%  184KB 184.5KB/s   00:00    
icu-71.1.tgz                                  100%   30MB   1.2MB/s   00:25    
hicolor-icon-theme-0.17nb1.tgz                100%   14KB  14.4KB/s   00:00    
gtk3+-3.24.34nb2.tgz                          100%   25MB   1.5MB/s   00:17    
ffmpeg5-5.1.1nb1.tgz                          100%   20MB   2.9MB/s   00:07    
dbus-glib-0.112nb1.tgz                        100%  261KB 261.1KB/s   00:01    
firefox102-102.4.0.tgz                        100%   68MB   2.0MB/s   00:34    
installing firefox102-102.4.0...
No schema files found: doing nothing.
p11-kit-0.24.1: copying /usr/pkg/share/examples/p11-kit/pkcs11.conf.example to /usr/pkg/etc/pkcs11/pkcs11.conf
xmlcatmgr-2.2nb1: copying /usr/pkg/share/examples/xmlcatmgr/catalog.etc.sgml to /usr/pkg/etc/sgml/catalog
xmlcatmgr-2.2nb1: copying /usr/pkg/share/examples/xmlcatmgr/catalog.etc.xml to /usr/pkg/etc/xml/catalog
xmlcatmgr-2.2nb1: copying /usr/pkg/share/examples/xmlcatmgr/catalog.share.sgml to /usr/pkg/share/sgml/catalog
xmlcatmgr-2.2nb1: copying /usr/pkg/share/examples/xmlcatmgr/catalog.share.xml to /usr/pkg/share/xml/catalog
dbus-1.14.0nb3: setting permissions on /usr/pkg/libexec/dbus-daemon-launch-helper (o=root, g=dbus, m=4511)
===========================================================================
The following files should be created for dbus-1.14.0nb3:

        /etc/rc.d/dbus (m=0755)
            [/usr/pkg/share/examples/rc.d/dbus]

===========================================================================
===========================================================================
$NetBSD: MESSAGE.rcd,v 1.2 2021/11/07 19:14:15 khorben Exp $

You should enable the dbus system-wide daemon for correct operation. Use:

$ cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/dbus

Edit /etc/rc.conf to set dbus=YES.

===========================================================================
===========================================================================
$NetBSD: MESSAGE.rcd,v 1.2 2021/11/07 19:14:15 khorben Exp $

You should enable the dbus system-wide daemon for correct operation. Use:

$ cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/dbus

Edit /etc/rc.conf to set dbus=YES.

===========================================================================
libpaper-1.1.28: copying /usr/pkg/share/examples/libpaper/papersize to /usr/pkg/etc/papersize
at-spi2-core-2.40.3nb2: copying /usr/pkg/share/examples/at-spi2-core/at-spi2/accessibility.conf to /usr/pkg/etc/at-spi2/accessibility.conf
at-spi2-core-2.40.3nb2: copying /usr/pkg/share/examples/at-spi2-core/xdg/autostart/at-spi-dbus-bus.desktop to /usr/pkg/etc/xdg/autostart/at-spi-dbus-bus.desktop
installing pciutils-3.8.0...
installing nss-3.83...
installing nspr-4.35...
installing libwebp-1.2.4...
installing libv4l-1.22.1...
installing libffi-3.4.2nb3...
installing libIDL-0.8.14nb6...
installing icu-71.1...
installing hicolor-icon-theme-0.17nb1...
installing gtk3+-3.24.34nb2...
No schema files found: removed existing output file.
installing ffmpeg5-5.1.1nb1...
installing dbus-glib-0.112nb1...
installing dbus-1.14.0nb3...
===========================================================================
The following users are no longer being used by dbus-1.14.0nb3,
and they can be removed if no other software is using them:

        dbus

===========================================================================
===========================================================================
The following groups are no longer being used by dbus-1.14.0nb3,
and they can be removed if no other software is using them:

        dbus

===========================================================================
===========================================================================
The following directories are no longer being used by dbus-1.14.0nb3,
and they can be removed if no other packages are using them:

        /var/lib/dbus

===========================================================================
dbus-1.14.0nb3: setting permissions on /usr/pkg/libexec/dbus-daemon-launch-helper (o=root, g=dbus, m=4511)
===========================================================================
The following files should be created for dbus-1.14.0nb3:

        /etc/rc.d/dbus (m=0755)
            [/usr/pkg/share/examples/rc.d/dbus]

===========================================================================
===========================================================================
$NetBSD: MESSAGE.rcd,v 1.2 2021/11/07 19:14:15 khorben Exp $

You should enable the dbus system-wide daemon for correct operation. Use:

$ cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/dbus

Edit /etc/rc.conf to set dbus=YES.

===========================================================================
===========================================================================
$NetBSD: MESSAGE.rcd,v 1.2 2021/11/07 19:14:15 khorben Exp $

You should enable the dbus system-wide daemon for correct operation. Use:

$ cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/dbus

Edit /etc/rc.conf to set dbus=YES.

===========================================================================
installing xvidcore-1.3.7...
installing x265-3.5...
installing x264-devel-20191217nb3...
installing speex-1.2.1...
installing libxml2-2.9.14...
installing libvpx-1.12.0...
installing libvorbis-1.3.7...
installing libva-2.15.0...
installing libtheora-1.1.1nb2...
installing libopus-1.3.1...
installing libbluray-1.3.2...
installing libass-0.16.0...
installing libaom-3.4.0...
installing lame-3.100nb4...
installing gnutls-3.7.7...
installing dav1d-1.0.0...
installing wayland-protocols-1.26nb1...
installing wayland-1.21.0...
installing shared-mime-info-1.10nb6...
installing pango-1.50.8...
installing libxkbcommon-1.4.1...
installing libcups-2.4.2nb1...
installing gdk-pixbuf2-2.42.9...
installing fribidi-1.0.11...
installing cairo-gobject-1.16.0nb6...
installing cairo-1.16.0nb6...
installing atk-2.36.0nb1...
installing at-spi2-atk-2.38.0nb1...
installing glib2-2.72.3...
installing tiff-4.4.0...
installing png-1.6.37nb1...
installing jpeg-9e...
installing giflib-5.2.1nb4...
installing jbigkit-2.1nb1...
installing pcre-8.45...
installing at-spi2-core-2.40.3nb2...
at-spi2-core-2.40.3nb2: copying /usr/pkg/share/examples/at-spi2-core/at-spi2/accessibility.conf to /usr/pkg/etc/at-spi2/accessibility.conf
at-spi2-core-2.40.3nb2: copying /usr/pkg/share/examples/at-spi2-core/xdg/autostart/at-spi-dbus-bus.desktop to /usr/pkg/etc/xdg/autostart/at-spi-dbus-bus.desktop
installing lzo-2.10...
installing libpaper-1.1.28...
libpaper-1.1.28: copying /usr/pkg/share/examples/libpaper/papersize to /usr/pkg/etc/papersize
installing graphite2-1.3.14...
installing libxslt-1.1.34nb10...
installing libepoll-shim-0.0.20210418nb2...
installing p11-kit-0.24.1...
p11-kit-0.24.1: copying /usr/pkg/share/examples/p11-kit/pkcs11.conf.example to /usr/pkg/etc/pkcs11/pkcs11.conf
installing nettle-3.8.1...
installing mozilla-rootcerts-1.0.20220614...
installing libunistring-1.0...
installing libtasn1-4.19.0...
installing libcfg+-0.7.0...
installing gmp-6.2.1nb3...
installing harfbuzz-5.1.0...
installing enca-1.15...
installing xmlcatmgr-2.2nb1...
xmlcatmgr-2.2nb1: copying /usr/pkg/share/examples/xmlcatmgr/catalog.etc.sgml to /usr/pkg/etc/sgml/catalog
xmlcatmgr-2.2nb1: copying /usr/pkg/share/examples/xmlcatmgr/catalog.etc.xml to /usr/pkg/etc/xml/catalog
xmlcatmgr-2.2nb1: copying /usr/pkg/share/examples/xmlcatmgr/catalog.share.sgml to /usr/pkg/share/sgml/catalog
xmlcatmgr-2.2nb1: copying /usr/pkg/share/examples/xmlcatmgr/catalog.share.xml to /usr/pkg/share/xml/catalog
installing libogg-1.3.5nb1...
installing libgcrypt-1.10.1...
installing libgpg-error-1.45...
pkg_install warnings: 135, errors: 0
pkg_install error log can be found in /var/db/pkgin/pkg_install-err.log
reading local summary...
processing local summary...
marking firefox102-102.4.0 as non auto-removable

firefox102-102.4.0 のインストールが完了したようでござる。

Firefox がインストールされたかどうかの確認

pkg_info コマンドを使って、 firefox102-102.4.0 がインストールされてい るかどうか、確認してみるでござる。


# pkg_info | grep firefox
firefox102-102.4.0  Web browser with support for extensions (version 102ESR)

インストールされているようでござる。

Firefox の起動

実際に利用できるかどうか、 firefox102 コマンドを実行してみるでござる。


% firefox102 &

以下のウィンドウが現れ、 Firefox が使えるでござる。

fig_202301/firefox102_aarch64.png

参考文献



Frequently accessed files

  1. Computer___Python/20220518_0.html
  2. Computer___Network/20230726_00.html
  3. Misc___Taiwan/20240207_00.html
  4. Computer___Network/20230516_00.html
  5. Computer___FreeBSD/20220621_0.html
  6. Computer___Python/20220715_0.html
  7. Computer___Network/20230508_00.html
  8. Food___Taiwan/20220429_0.html
  9. Computer___Network/20240130_00.html
  10. Computer___Python/20220410_0.html
  11. Computer___NetBSD/20220817_3.html
  12. Computer___Network/20240416_00.html
  13. Computer___NetBSD/20230119_00.html
  14. Computer___Debian/20210223_1.html
  15. Computer___Python/20221013_0.html
  16. Computer___Python/20210124_0.html
  17. Computer___NetBSD/20220428_0.html
  18. Computer___NetBSD/20220818_1.html
  19. Computer___NetBSD/20240101_02.html
  20. Computer___Python/20240101_00.html
  21. Science___Math/20220420_0.html
  22. Computer___NetBSD/20220808_0.html
  23. Computer___TeX/20230503_00.html
  24. Computer___Network/20220413_1.html
  25. Science___Astronomy/20220503_0.html
  26. Computer___NetBSD/20230515_00.html
  27. Computer___NetBSD/20210127_0.html
  28. Computer___TeX/20231107_00.html
  29. Computer___Python/20220816_1.html
  30. Computer___Python/20230717_01.html


HTML file generated by Kinoshita Daisuke.