-
Notifications
You must be signed in to change notification settings - Fork 0
/
handbook.7.html
1755 lines (1211 loc) · 79.3 KB
/
handbook.7.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" href="pod2html.css" type="text/css" />
<link rel="shortcut icon" href="https://raw.githubusercontent.com/zeppe-lin/artwork/master/logo-small.png">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@v1r91n.nonet" />
</head>
<body>
<ul id="index">
<li><a href="#PREFACE">1. PREFACE</a></li>
<li><a href="#INTRODUCTION">2. INTRODUCTION</a>
<ul>
<li><a href="#What-is-Zeppe-Lin">2.1. What is Zeppe-Lin?</a></li>
<li><a href="#Why-use-Zeppe-Lin">2.2. Why use Zeppe-Lin?</a></li>
</ul>
</li>
<li><a href="#LICENSE">3. LICENSE</a>
<ul>
<li><a href="#Packages">3.1. Packages</a></li>
<li><a href="#Build-Scripts">3.2. Build Scripts</a></li>
<li><a href="#NO-WARRANTY">3.3. NO WARRANTY</a></li>
</ul>
</li>
<li><a href="#INSTALLATION">4. INSTALLATION</a>
<ul>
<li><a href="#Supported-Hardware">4.1. Supported Hardware</a></li>
<li><a href="#Boot-a-Live-System">4.2. Boot a Live System</a></li>
<li><a href="#Disk-Partitions-and-Filesystems">4.3. Disk Partitions and Filesystems</a>
<ul>
<li><a href="#UEFI-and-LVM-on-LUKS">4.3.1. UEFI and LVM-on-LUKS</a>
<ul>
<li><a href="#Partition-scheme">4.3.1.1. Partition scheme</a></li>
<li><a href="#Create-the-partitions">4.3.1.2. Create the partitions</a></li>
<li><a href="#Create-LVM-inside-LUKS-device">4.3.1.3. Create LVM inside LUKS device</a></li>
<li><a href="#Create-the-filesystems">4.3.1.4. Create the filesystems</a></li>
<li><a href="#Mount-prepared-partitions">4.3.1.5. Mount prepared partitions</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#Install-Base-System">4.4. Install Base System</a>
<ul>
<li><a href="#Download-rootfs-tarball">4.4.1. Download rootfs tarball</a></li>
<li><a href="#Verify-downloaded-tarball">4.4.2. Verify downloaded tarball</a></li>
<li><a href="#Extract-rootfs-tarball">4.4.3. Extract rootfs tarball</a></li>
</ul>
</li>
<li><a href="#Chroot-Into-Base-System">4.5. Chroot Into Base System</a></li>
<li><a href="#Configure-The-Base-System">4.6. Configure The Base System</a></li>
<li><a href="#Prepare-The-PKGSRC-Repos">4.7. Prepare The PKGSRC Repos</a></li>
<li><a href="#Update-The-Base-System">4.8. Update The Base System</a></li>
<li><a href="#Install-essential-packages">4.9. Install essential packages</a></li>
<li><a href="#Prepare-a-Linux-Kernel">4.10. Prepare a Linux Kernel</a>
<ul>
<li><a href="#Install-kernel-package">4.10.1. Install kernel package</a></li>
<li><a href="#Install-the-kernel-manually">4.10.2. Install the kernel manually</a></li>
</ul>
</li>
<li><a href="#Prepare-Initramfs-Image">4.11. Prepare Initramfs Image</a></li>
<li><a href="#Install-a-Bootloader">4.12. Install a Bootloader</a>
<ul>
<li><a href="#GRUB">4.12.1. GRUB</a></li>
</ul>
</li>
<li><a href="#Post-installation-Tasks">4.13. Post-installation Tasks</a>
<ul>
<li><a href="#Install-X11">4.13.1. Install X11</a></li>
<li><a href="#Reboot">4.13.2. Reboot</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#THE-PACKAGE-SYSTEM">5. THE PACKAGE SYSTEM</a>
<ul>
<li><a href="#Introduction">5.1. Introduction</a>
<ul>
<li><a href="#Basic-package-management-tools">5.1.1. Basic package management tools</a></li>
</ul>
</li>
<li><a href="#Using-the-Package-System">5.2. Using the Package System</a>
<ul>
<li><a href="#Installing-a-package">5.2.1. Installing a package</a></li>
<li><a href="#Upgrading-a-package">5.2.2. Upgrading a package</a>
<ul>
<li><a href="#Rejected-files">5.2.2.1. Rejected files</a></li>
</ul>
</li>
<li><a href="#Removing-a-package">5.2.3. Removing a package</a></li>
<li><a href="#Querying-the-package-database">5.2.4. Querying the package database</a></li>
</ul>
</li>
<li><a href="#Package-Management-Front-end:-pkgman">5.3. Package Management Front-end: pkgman</a>
<ul>
<li><a href="#Functionality">5.3.1. Functionality</a></li>
<li><a href="#Configuration">5.3.2. Configuration</a></li>
</ul>
</li>
<li><a href="#Creating-Packages">5.4. Creating Packages</a></li>
<li><a href="#Configuring-the-Package-Build-Process">5.5. Configuring the Package Build Process</a></li>
</ul>
</li>
<li><a href="#THE-PKGSRC-SYSTEM">6.0. THE PKGSRC SYSTEM</a>
<ul>
<li><a href="#Introduction1">6.1. Introduction</a>
<ul>
<li><a href="#What-is-a-package-source">6.1.1. What is a package source?</a></li>
<li><a href="#What-is-a-pkgsrc-repository">6.1.2. What is a pkgsrc repository?</a></li>
<li><a href="#The-pkgsrc-collections">6.1.3. The pkgsrc collections</a></li>
</ul>
</li>
<li><a href="#Using-The-Pkgsrc">6.2. Using The Pkgsrc</a>
<ul>
<li><a href="#Synchronizing-your-local-pkgsrc-repositories">6.2.1. Synchronizing your local pkgsrc repositories</a></li>
<li><a href="#Listing-local-pkgsrc-repositories">6.2.2. Listing local pkgsrc repositories</a></li>
<li><a href="#Listing-version-differences">6.2.3. Listing version differences</a></li>
<li><a href="#Building-and-installing-packages">6.2.4. Building and installing packages</a></li>
<li><a href="#Build-packages-as-an-unprivileged-user">6.2.5. Build packages as an unprivileged user</a></li>
<li><a href="#Renice-pkgmks-child-process">6.2.6. Renice pkgmk's child process</a></li>
<li><a href="#Build-in-ram">6.2.7. Build in ram</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#CONFIGURATION">7. CONFIGURATION</a>
<ul>
<li><a href="#Generating-Locales">7.1. Generating Locales</a></li>
<li><a href="#Initialization-Scripts">7.2. Initialization Scripts</a>
<ul>
<li><a href="#Runlevels">7.2.1. Runlevels</a></li>
<li><a href="#Layout">7.2.2. Layout</a></li>
</ul>
</li>
<li><a href="#Network-Configuration">7.3. Network Configuration</a>
<ul>
<li><a href="#Static-address">7.3.1. Static address</a></li>
<li><a href="#Dynamic-address">7.3.2. Dynamic address</a></li>
<li><a href="#Wireless-network">7.3.3. Wireless network</a></li>
</ul>
</li>
<li><a href="#Passwords">7.4. Passwords</a></li>
</ul>
</li>
<li><a href="#REPORTING-BUGS">8. REPORTING BUGS</a></li>
</ul>
<h1 id="PREFACE">1. PREFACE</h1>
<p>This handbook (and Zeppe-Lin itself) is inspired and based on the <a href="http://crux.nu/Main/Documentation">CRUX Handbook</a>. The original version was written by Per Lidén <a href="mailto:per@fukt.bth.se">mailto:per@fukt.bth.se</a> and maintained by CRUX Team. This implementation was reworked and adapted for Zeppe-Lin by Alexandr Savca <a href="mailto:alexandr.savca89@gmail.com">mailto:alexandr.savca89@gmail.com</a>.</p>
<h1 id="INTRODUCTION">2. INTRODUCTION</h1>
<p>Welcome to the Zeppe-Lin Handbook! It's not an extensive guide on how to use and configure common Linux software. The purpose of the handbook is to explain how to install, configure, and maintain Zeppe-Lin systems, and to highlight the differences between common Linux distributions and Zeppe-Lin.</p>
<ul>
<li><p>The online version of this handbook is placed at: <a href="https://zeppe-lin.github.io/handbook.7.html">https://zeppe-lin.github.io/handbook.7.html</a>.</p>
</li>
<li><p>The pdf version of this handbook can be downloaded at: <a href="https://zeppe-lin.github.io/handbook.7.pdf">https://zeppe-lin.github.io/handbook.7.pdf</a>.</p>
</li>
<li><p>The local copy of this handbook can be installed on Zeppe-Lin system by the following command:</p>
<pre><code># pkgman install handbook</code></pre>
</li>
</ul>
<h2 id="What-is-Zeppe-Lin">2.1. What is Zeppe-Lin?</h2>
<p>Zeppe-Lin is a lightweight GNU/Linux distribution for the x86-64 architecture targeted at experienced users. It is forked from CRUX and the primary focus of this distribution is "keep it simple" too.</p>
<p>The KISS principle reflects in a simple <i>tar.gz</i>-based package system, BSD-style init scripts, and a relatively small collection of trimmed packages.</p>
<p>The secondary focus is the utilization of new GNU/Linux features and recent tools and libraries.</p>
<h2 id="Why-use-Zeppe-Lin">2.2. Why use Zeppe-Lin?</h2>
<p>In short, Zeppe-Lin might suit you very well if you are:</p>
<ul>
<li><p>an experienced user who wants a clean and simple GNU/Linux distribution as a foundation of your installation;</p>
</li>
<li><p>a person who prefers editing configuration files with an editor to using GUI;</p>
</li>
<li><p>someone who does not hesitate to download and compile programs from the source;</p>
</li>
<li><p>someone who wants a KISS GNU/Linux distribution as a foundation of your own distro;</p>
</li>
</ul>
<h1 id="LICENSE">3. LICENSE</h1>
<h2 id="Packages">3.1. Packages</h2>
<p>Since Zeppe-Lin is a GNU/Linux distribution, it contains software written by a lot of different people. Each software package comes with its own license, chosen by its author(s). To find out how a particular package is licensed, have a look at its source code.</p>
<h2 id="Build-Scripts">3.2. Build Scripts</h2>
<p>All package build scripts in Zeppe-Lin are Copyright (C) 2000-2021 by Per Lidén <a href="mailto:per@fukt.bth.se">mailto:per@fukt.bth.se</a> and CRUX team <a href="http://crux.nu">http://crux.nu</a> and are released under the GPLv3+: GNU General Public License version 3 or later <a href="https://gnu.org/licenses/gpl.html">https://gnu.org/licenses/gpl.html</a>.</p>
<h2 id="NO-WARRANTY">3.3. NO WARRANTY</h2>
<p>Zeppe-Lin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use it at YOUR OWN RISK.</p>
<h1 id="INSTALLATION">4. INSTALLATION</h1>
<h2 id="Supported-Hardware">4.1. Supported Hardware</h2>
<p>Packages on the official <b>rootfs</b> image are compiled with optimization for x86-64 (AMD Athlon 64, Intel Core, Intel Atom) or newer processors. Do not try to install it on an i686 (Pentium Pro, Celeron, Pentium-III) or lower processor, it simply will not work.</p>
<h2 id="Boot-a-Live-System">4.2. Boot a Live System</h2>
<p>Since Zeppe-Lin is distributed in the form of a compiled tarball containing a root filesystem, you will first need to boot your computer using a Linux-based image, so called "Live CD/DVD/USB" operating system.</p>
<p>Boot from the live CD/DVD/USB, open a terminal and get root privileges (e.g. <code>sudo su</code>).</p>
<h2 id="Disk-Partitions-and-Filesystems">4.3. Disk Partitions and Filesystems</h2>
<h3 id="UEFI-and-LVM-on-LUKS"><b>4.3.1. UEFI and LVM-on-LUKS</b></h3>
<p>This section describes how to set up Zeppe-Lin on a fully encrypted disk (apart from the bootloader partition). We will have an LVM container installed inside an encrypted partition. To encrypt the partition containing the LVM volume group, <b>dm-crypt</b> (which is managed by the <a href="cryptsetup.8.html">cryptsetup(8)</a> command) and its LUKS subsystem is used.</p>
<dl>
<dt id="Important"><b>Important</b>:</dt>
<dd>
<p>Make sure you have the following packages installed on your live system: <b>parted</b>, <b>dosfstools</b>, <b>cryptsetup</b>, and <b>lvm2</b>.</p>
</dd>
</dl>
<h4 id="Partition-scheme"><b>4.3.1.1. Partition scheme</b></h4>
<p>This is a quite simple partition scheme used in this section. There is a SCSI disk <code>/dev/sda</code>, but if you have an NVME disk (like <code>/dev/nvme0n1</code>) or another SCSI disk (like <code>/dev/sdb</code>), it's simple as run <code>sed 's/sda/sdb/g'</code>.</p>
<table>
<tr>
<th>Partition</th>
<th>Filesystem</th>
<th>Size</th>
<th>Description</th>
</tr>
<tr>
<td>/dev/sda1</td>
<td>fat32</td>
<td>512MB</td>
<td>boot partition</td>
</tr>
<tr>
<td>/dev/sda2</td>
<td>luks</td>
<td>rest of the disk</td>
<td>luks partition</td>
</tr>
</table>
<dl>
<dt id="Important1"><b>Important</b>:</dt>
<dd>
<p>On UEFI systems with a GPT-partitioned disk, there must be an EFI system partition (ESP). The suggested size is around 512 MiB.</p>
</dd>
</dl>
<h4 id="Create-the-partitions"><b>4.3.1.2. Create the partitions</b></h4>
<p>Using <a href="parted.8.html">parted(8)</a> utility we can create all required partitions.</p>
<pre><code># parted /dev/sda
(parted) mklabel gpt
(parted) mkpart ESP fat32 1MiB 513MiB
(parted) set 1 boot on
(parted) name 1 efiboot
(parted) mkpart primary 513MiB 100%
(parted) name 2 luks
(parted) quit</code></pre>
<p>Encrypt the second (luks) partition with LUKS and open the LUKS device (for example, as <code>crypt</code> mapped name):</p>
<pre><code># cryptsetup luksFormat /dev/sda2
# cryptsetup luksOpen /dev/sda2 crypt</code></pre>
<h4 id="Create-LVM-inside-LUKS-device"><b>4.3.1.3. Create LVM inside LUKS device</b></h4>
<p>Create a physical volume and a new volume group (named <code>zpln</code> for example):</p>
<pre><code># pvcreate /dev/mapper/crypt
# vgcreate zpln /dev/mapper/crypt</code></pre>
<p>Before creating the logical volumes, this is a quite simple logical volumes scheme used in this section:</p>
<table>
<tr>
<th>Volume name</th>
<th>Filesystem</th>
<th>Size</th>
<th>Description</th>
</tr>
<tr>
<td>swap</td>
<td>swap</td>
<td>2 * RAM</td>
<td>swap area</td>
</tr>
<tr>
<td>root</td>
<td>ext4</td>
<td>rest of the disk</td>
<td>root fs</td>
</tr>
</table>
<p>To see the actual amount of RAM, type the following command:</p>
<pre><code># free -m</code></pre>
<p>For example, we have 4GB RAM. The swap will have 8GB. Let's create the aforementioned two logical volumes:</p>
<pre><code># lvcreate -L 8G -n swap zpln
# lvcreate -l 100%FREE -n root zpln</code></pre>
<h4 id="Create-the-filesystems"><b>4.3.1.4. Create the filesystems</b></h4>
<p>Create a FAT32 filesystem for the first (boot) partition:</p>
<pre><code># mkfs.vfat -F32 /dev/sda1</code></pre>
<p>Create root filesystem:</p>
<pre><code># mkfs.ext4 /dev/zpln/root</code></pre>
<p>Format swap logical volume as swap area and activate it:</p>
<pre><code># mkswap /dev/zpln/swap
# swapon /dev/zpln/swap</code></pre>
<h4 id="Mount-prepared-partitions"><b>4.3.1.5. Mount prepared partitions</b></h4>
<p>In this handbook, the <code>/mnt</code> directory is used as a default mountpoint.</p>
<pre><code># mount /dev/zpln/root /mnt
# mkdir /mnt/boot
# mount /dev/sda1 /mnt/boot</code></pre>
<h2 id="Install-Base-System">4.4. Install Base System</h2>
<h3 id="Download-rootfs-tarball"><b>4.4.1. Download rootfs tarball</b></h3>
<p>As mentioned before, the <code>/mnt</code> directory is the default mountpoint for our system. Let's download the rootfs tarball into this directory so we won't pollute live CD/DVD/USB RAM:</p>
<pre><code># cd /mnt
# wget -c https://github.com/zeppe-lin/pkgsrc-core/releases/download/v0.99.1/rootfs-v0.99.1-x86_64.tar.xz{,.sig}</code></pre>
<h3 id="Verify-downloaded-tarball"><b>4.4.2. Verify downloaded tarball</b></h3>
<p>Zeppe-Lin rootfs tarball is signed using GPG. It's a good practice to verify authenticity and integrity of downloaded files when possible.</p>
<pre><code># gpg --keyserver keyserver.ubuntu.com --recv-keys 59ec1986fbd902cf
# gpg --verify rootfs-v0.99.1-x86_64.tar.xz{.sig,}</code></pre>
<h3 id="Extract-rootfs-tarball"><b>4.4.3. Extract rootfs tarball</b></h3>
<p>Once the rootfs tarball is downloaded and verified, extract the contents with the following command:</p>
<pre><code># tar --numeric-owner --xattrs --xattrs-include='*' -xpf \
rootfs-v0.99.1-x86_64.tar.xz</code></pre>
<dl>
<dt id="Important2"><b>Important</b>:</dt>
<dd>
<p>It is very important to use all the options included above. See below for details.</p>
</dd>
</dl>
<p>Here are what the options to <a href="tar.1.html">tar(1)</a> do:</p>
<dl>
<dt id="numeric-owner"><b>--numeric-owner</b></dt>
<dd>
<p>Without this option, <a href="tar.1.html">tar(1)</a> will map ownership and group ownership based on the UID to user and GID to group mappings as defined on the Live CD/DVD/USB. By specifying <b>--numeric-owner</b> we tell that we want the <i>numeric values</i> of the UIDs and GIDs in the tarball to be preserved on disk, so when your Zeppe-Lin system boots, the UIDs and GIDs are set correctly for Zeppe-Lin.</p>
</dd>
<dt id="xattrs---xattrs-include"><b>--xattrs --xattrs-include='*'</b></dt>
<dd>
<p>Zeppe-Lin uses filesystem extended attributes to set Linux capabilities, which allow for certain programs such as ping to have enhanced privileges without having to be fully 'suid root'. Even with the <b>-p</b> option, <a href="tar.1.html">tar(1)</a> will not restore extended attributes we need unless these two options are specified.</p>
</dd>
<dt id="xpf"><b>-xpf</b></dt>
<dd>
<p>Extract (<b>x</b>), preserve regular permissions and ownership (<b>p</b>), and use the filename (<b>f</b>) specified.</p>
</dd>
</dl>
<h2 id="Chroot-Into-Base-System">4.5. Chroot Into Base System</h2>
<p>Copy DNS configuration to have the availability to use the network from the chrooted root:</p>
<pre><code># cp /etc/resolv.conf etc/resolv.conf</code></pre>
<p>Mount Linux's pseudo-filesystems:</p>
<pre><code># mount -B /dev /mnt/dev
# mount -B /tmp /mnt/tmp
# mount -B /run /mnt/run
# mount -t proc proc /mnt/proc
# mount -t sysfs none /mnt/sys
# mount -t devpts -o noexec,nosuid,gid=tty,mode=0620 devpts \
/mnt/dev/pts
(UEFI only)
# mount -B /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
# chroot /mnt /bin/bash</code></pre>
<p>Set the <b>SHELL</b> environment variable to <i>/bin/bash</i> in the chrooted environment, to be available to call <code>:shell</code> in vim, for example, or other tools that relies on <code>SHELL</code>. This needs if the shell used outside chroot is zsh, fish, or something else that is not present in chroot environment:</p>
<pre><code>(chrooted) # export SHELL=/bin/bash</code></pre>
<h2 id="Configure-The-Base-System">4.6. Configure The Base System</h2>
<p>Set the root password:</p>
<pre><code>(chrooted) # passwd root</code></pre>
<p>Make sure files have proper ownership and permissions:</p>
<pre><code>(chrooted) # chown root:root /
(chrooted) # chmod 755 /</code></pre>
<p><b>Glibc</b> does not contain all possible locales, thus you'll have to generate the locales you need/use. To ensure the proper operation of <a href="pkgmk.8.html">pkgmk(8)</a>, the locale <code>C.UTF-8</code> is generated as part of the Zeppe-Lin installation. Any other desired locales must be created by the administrator. Let's prepare <code>en_US.UTF-8</code> (you may choose locale you need):</p>
<pre><code>(chrooted) # localedef -i en_US -f UTF-8 en_US.UTF-8</code></pre>
<p>Then add <code>export LANG=en_US.UTF-8</code> to <i>/etc/profile</i> to make it system-wide.</p>
<p>Edit <i>/etc/fstab</i> (see <a href="fstab.5.html">fstab(5)</a> for more information) to configure your filesystems and add the prepared partitions. For example, for <a href="#UEFI-and-LVM-on-LUKS">"4.3.1. UEFI and LVM-on-LUKS"</a> installation, you may specify the following:</p>
<pre><code>/dev/zpln/root / ext4 defaults,noatime,nodiratime 1 2
/dev/sda1 /boot vfat defaults,noatime,nodiratime 1 2
/dev/zpln/swap swap swap defaults 0 0</code></pre>
<dl>
<dt id="Note"><b>Note</b>:</dt>
<dd>
<p>You can use <code>/dev/disk/by-uuid/*</code> or <code>UUID=xxx</code> instead of <code>/dev/*</code> used above to prevent boot failures on machines with multiple disks. Use <a href="blkid.8.html">blkid(8)</a> to verify the disk's UUID:</p>
<pre><code>(chrooted) # blkid -o value -s UUID <DEVICE>
...</code></pre>
</dd>
</dl>
<p>Uncomment <i>/var/cache/pkgmk/work</i> if you want to build packages in RAM.</p>
<p>Mount <b>fstab</b> entries:</p>
<pre><code>At least python3 won't build without that:
(chrooted) # mount /dev/shm
If you setup UEFI:
(chrooted) # mount /sys/firmware/efi/efivars
If you setup using tmpfs for /tmp:
(chrooted) # mount /tmp
If you setup to build packages in RAM:
(chrooted) # mount /var/cache/pkgmk/work</code></pre>
<p>Edit <i>/etc/rc.conf</i> (see <a href="rc.conf.5.html">rc.conf(5)</a> for more information) to configure font, keyboard, timezone, hostname, and services.</p>
<p>Edit <i>/etc/rc.d/net</i>, <i>/etc/hosts</i>, and <i>/etc/resolv.conf</i> to configure your network (IP address/Gateway/Hostname/Domain/DNS). If you want to configure the networking bridge, see <i>/etc/rc.d/bridge</i>.</p>
<p>It's better to add the ordinary user now if you want a specific user id because the following installation of packages creates its own users and they may occupy your id:</p>
<pre><code>(chrooted) # useradd --shell /bin/bash --create-home \
--groups audio,video,scanner,cdrom,input,users \
--uid 1000 --user-group $USERNAME
(chrooted) # passwd $USERNAME</code></pre>
<p>To make this user privileged (e.g. as Ubuntu does), first, you need to add the <code>$USERNAME</code> to the <code>wheel</code> group:</p>
<pre><code>(chrooted) # usermod -aG wheel $USERNAME</code></pre>
<p>And second, grant the users in the <code>whell</code> group to be root:</p>
<pre><code>#
# /etc/sudoers.d/00wheel: grant users in the wheel group to be root
#
%wheel ALL=(ALL:ALL) ALL
# End of file.</code></pre>
<h2 id="Prepare-The-PKGSRC-Repos">4.7. Prepare The PKGSRC Repos</h2>
<p>Packages' sources are organized in so-called collections, see <a href="#The-pkgsrc-collections">"6.1.3. The pkgsrc collections"</a> for more information about that.</p>
<p>Clone the collections you need, but keep in mind that each subsequent collection depends on the previous ones.</p>
<pre><code>(chrooted) # cd /usr/src/
(chrooted) # git clone https://github.com/zeppe-lin/pkgsrc-core
(chrooted) # git clone https://github.com/zeppe-lin/pkgsrc-system
(chrooted) # git clone https://github.com/zeppe-lin/pkgsrc-xorg
(chrooted) # git clone https://github.com/zeppe-lin/pkgsrc-desktop</code></pre>
<p>Edit <i>/etc/pkgman.conf</i> (see <a href="pkgman.conf.5.html">pkgman.conf(5)</a> for more information) and enable the collections you cloned. By default, only <code>pkgsrc-core</code> collection is enabled. Also, you may like to edit <i>/etc/pkgmk.conf</i> (see <a href="pkgmk.conf.5.html">pkgmk.conf(5)</a> for more information).</p>
<h2 id="Update-The-Base-System">4.8. Update The Base System</h2>
<p>Before installing any package you need, it's highly recommended to update the system which you just installed.</p>
<dl>
<dt id="Warning"><b>Warning</b>:</dt>
<dd>
<p>Starting from version <code>6.0</code>, <code>pkgutils</code> has broken backward compatibility when generating footprint files. So, at the beginning it is recommended to update <code>pkgmk</code> and <code>pkgutils</code>:</p>
<pre><code>(chrooted) # pkgman update -f pkgmk pkgutils</code></pre>
</dd>
</dl>
<p>The following command tells to <a href="pkgman.1.html">pkgman(1)</a> to run system update (with dependency handling/sorting) and to stop if installation of at least one package fails:</p>
<pre><code>(chrooted) # pkgman sysup --deps --depsort --group</code></pre>
<p>It's also recommended to merge the files that were rejected during updates:</p>
<pre><code>(chrooted) # rejmerge</code></pre>
<p>And it's a good idea to check which packages need to be rebuilt:</p>
<pre><code>(chrooted) # revdep</code></pre>
<p>If <b>revdep(1)</b> showed anything rebuild them as follows:</p>
<pre><code>(chrooted) # pkgman update -fr --depsort `revdep`</code></pre>
<h2 id="Install-essential-packages">4.9. Install essential packages</h2>
<p>Let's install all the necessary packages for the so-called workstation:</p>
<pre><code>(chrooted) # pkgman install --deps --group \
cryptsetup e2fsprogs dosfstools grub2 grub2-efi iw gnupg \
lvm2 pinentry wireless-tools wpa-supplicant dhcpcd iputils</code></pre>
<p>Edit <i>/etc/rc.d/dhcpcd</i> and <i>/etc/rc.d/wpa_supplicant</i> and setup your network interfaces.</p>
<dl>
<dt id="Note1"><b>Note</b>:</dt>
<dd>
<p>If you configured the networking bridge, don't forget to specify the bridge interface to <b>dhcpcd</b> and/or <b>wpa_supplicant</b> RC scripts.</p>
</dd>
</dl>
<h2 id="Prepare-a-Linux-Kernel">4.10. Prepare a Linux Kernel</h2>
<p>Follow only one of the two following subsections.</p>
<h3 id="Install-kernel-package"><b>4.10.1. Install kernel package</b></h3>
<p>The <code>pkgsrc-system</code> collection provides a package with the kernel and non-free firmware:</p>
<pre><code>(chrooted) # pkgman install --deps --group \
--config-append="runscripts no" linux linux-firmware</code></pre>
<p>This <b>linux</b> package has a <b>post-install</b> script that executes <a href="mkinitramfs.8.html">mkinitramfs(8)</a> and updates the <b>grub</b> config. We turn off the execution of this script because we'll do it manually. It is useful when regularly updating the system but now it's unnecessary.</p>
<dl>
<dt id="Note2"><b>Note</b>:</dt>
<dd>
<p>You may like to lock the <b>linux</b> package and not update it during regular system updates, since the update will remove the current working kernel and its modules. If you plan not to turn off the computer for a long time, it is better to do this and update the kernel separately, through <a href="pkgman-update.8.html">pkgman-update(8)</a>. See <a href="pkgman-lock.8.html">pkgman-lock(8)</a> for more information about package locking.</p>
</dd>
</dl>
<p>If you installed the kernel package through a package manager, you can jump over the next paragraph, to the <a href="#Prepare-Initramfs-Image">"4.11. Prepare Initramfs Image"</a>.</p>
<h3 id="Install-the-kernel-manually"><b>4.10.2. Install the kernel manually</b></h3>
<p>Since the <a href="pkgman.1.html">pkgman(1)</a> build the package that contains only the binaries (kernel and modules), you may want to build your own kernel. For example, you do not need such a fat kernel, which goes by default, or you need the sources of the running kernel because you want to build the Nvidia driver and/or VirtualBox.</p>
<p>In this case, it is recommended to use the kernel from package sources.</p>
<p>So, let's download the <b>linux</b> source:</p>
<pre><code>(chrooted) # pkgman install -do linux</code></pre>
<p>The <code>-do</code> option means <code>download-only</code>. The source is downloaded to <i>/var/cache/pkgmk/sources</i> if you have not changed the <b>PKGMK_SOURCE_DIR</b> location in <i>/etc/pkgmk.conf</i>. Unpack it:</p>
<pre><code>(chrooted) # tar -xvf \
/var/cache/pkgmk/sources/linux-5.4.X.tar.?z -C /usr/src/</code></pre>
<p>You may want to enable Zeppe-Lin's patches:</p>
<pre><code>(chrooted) # cd linux-5.4.X
(chrooted) # for p in $(pkgman path linux)/*.patch; \
do patch -Np1 -i $p; done</code></pre>
<p>If you have downloaded a non-packaged kernel, you can print the results of applying the patches without actually changing any files. Just add <code>--dry-run</code> option.</p>
<p>Next, you can create your own, minimal config and adjust it to your system:</p>
<pre><code>(chrooted) # make menuconfig</code></pre>
<p>Or you can use the <code>all-inclusive</code> config from the package:</p>
<pre><code>(chrooted) # cp $(pkgman path linux)/x86_64-dotconfig .config
(chrooted) # make olddefconfig</code></pre>
<p>Build the kernel and modules:</p>
<pre><code>(chrooted) # make -j$(nproc) all</code></pre>
<p>Install the kernel and modules:</p>
<pre><code>(chrooted) # KV=$(make kernelversion)
(chrooted) # cp arch/x86/boot/bzImage /boot/vmlinuz-$KV
(chrooted) # cp .config /boot/config-$KV
(chrooted) # make modules_install</code></pre>
<p>You may still need to install the kernel non-free firmware:</p>
<pre><code>(chrooted) # pkgman install --deps linux-firmware</code></pre>
<p>Next, we need to prepare the initramfs and update our bootloader.</p>
<h2 id="Prepare-Initramfs-Image">4.11. Prepare Initramfs Image</h2>
<p>Install <b>mkinitramfs</b> package:</p>
<pre><code>(chrooted) # pkgman install --deps mkinitramfs</code></pre>
<p>Add the <b>mkinitramfs</b> configuration file (<i>/etc/mkinitramfs/config</i>) with the following content:</p>
<pre><code>#
# /etc/mkinitramfs/config: mkinitramfs(8) configuration
#
# See mkinitramfs.config(5) for more information.
#
hostonly=1 #(optional)
compress="gzip --fast"
hooks="eudev luks lvm resume"
root=/dev/zpln/root
root_type=ext4
resume=/dev/zpln/swap
luks_name=crypt
luks_root=/dev/sda2
# End of file.</code></pre>
<p>See <a href="mkinitramfs.config.5.html">mkinitramfs.config(5)</a> for more information.</p>
<dl>
<dt id="Note3"><b>Note</b>:</dt>
<dd>
<p>As in case of <i>/etc/fstab</i>, you can use <code>/dev/disk/by-uuid/*</code> or <code>UUID=...</code> instead of <code>/dev/*</code> to prevent boot failures on machines with multiple disks. Use <a href="blkid.8.html">blkid(8)</a> to verify the disk's <code>UUID</code>:</p>
<pre><code>(chrooted) # blkid -o value -s UUID <DEVICE>
...</code></pre>
</dd>
</dl>
<p>Now, prepare an initramfs. If you installed the <code>linux</code> kernel manually, you have already set <code>KV</code> variable to kernel version. Otherwise, obtain the kernel version from package source like the following:</p>
<pre><code>(chrooted) # KV=$(pkgman printf %v --filter=linux)</code></pre>
<p>Now, generate an initramfs image:</p>
<pre><code>(chrooted) # mkinitramfs -o /boot/initramfs-$KV.img -k $KV</code></pre>
<h2 id="Install-a-Bootloader">4.12. Install a Bootloader</h2>
<h3 id="GRUB"><b>4.12.1. GRUB</b></h3>
<p>Create <i>/etc/default/grub</i> file with the following content:</p>
<pre><code>GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=ZPLN
GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=/dev/zpln/swap"</code></pre>
<p>Next, install <b>GRUB</b> on <code>/dev/sda</code> (your case may differ) drive:</p>
<pre><code>(chrooted) # grub-install --target=x86_64-efi \
--efi-directory=/boot /dev/sda</code></pre>
<p>Update <b>GRUB</b> configuration file:</p>
<pre><code>(chrooted) # grub-mkconfig -o /boot/grub/grub.cfg</code></pre>
<h2 id="Post-installation-Tasks">4.13. Post-installation Tasks</h2>
<h3 id="Install-X11"><b>4.13.1. Install X11</b></h3>
<p>See the available X11 video and input drivers, and choose the right one:</p>
<pre><code># pkgman search -vv xf86-</code></pre>
<p>Next, install the <b>xorg</b> package and the drivers you wish:</p>
<pre><code># pkgman install --deps --group xorg ...</code></pre>
<h3 id="Reboot"><b>4.13.2. Reboot</b></h3>
<p>Exit from chroot and umount <i>/mnt</i> and reboot:</p>
<pre><code>(chrooted) # exit
# cd /
# umount -R /mnt
# shutdown -r now</code></pre>
<h1 id="THE-PACKAGE-SYSTEM">5. THE PACKAGE SYSTEM</h1>
<h2 id="Introduction">5.1. Introduction</h2>
<h3 id="Basic-package-management-tools"><b>5.1.1. Basic package management tools</b></h3>
<p>The package system (<b>pkgutils</b>) is a fork of CRUX's pkgutils. It is made with simplicity in mind, where all packages are plain <i>tar.gz</i> files (i.e. without any kind of metadata).</p>
<p>Packages follow the naming convention <i>name#version-release.pkg.tar.gz</i>, where <i>name</i> is the name of the program, <i>version</i> is the version number of the program, and <i>release</i> is the version number of the package.</p>
<p>The <i>pkg.tar.gz</i> extension is used (instead of just <i>tar.gz</i>) to indicate that this is not just any <i>tar.gz</i> file, but a <i>tar.gz</i> that is meant to be installed using <a href="pkgadd.8.html">pkgadd(8)</a>. This helps distinguish packages from other <i>tar.gz</i> files. Note that <a href="pkgmk.8.html">pkgmk(8)</a> supports additional compression schemes like <b>bzip2</b> with the <i>tar.bz2</i> extension, <b>lzip</b> with <i>tar.lz</i>, <b>xz</b> with <i>tar.xz</i>, or <b>zstd</b> ending with <i>tar.zst</i>.</p>
<p><a href="pkgadd.8.html">pkgadd(8)</a>, <a href="pkgrm.8.html">pkgrm(8)</a>, and <a href="pkginfo.1.html">pkginfo(1)</a> are the basic package management utilities and are part of the package <b>pkgutils</b>. In addition to them, package management includes utilities such as <a href="pkgmk.8.html">pkgmk(8)</a>, <a href="rejmerge.8.html">rejmerge(8)</a>, and <a href="revdep.1.html">revdep(1)</a>.</p>
<p>They could also be considered basic, but they are placed in separate packages so that changes in one utility do not require rebuilding all of them.</p>
<p>With these utilities, you can install, uninstall, inspect, make packages, query the package database, merge files that were rejected during package upgrades, and check for missing libraries of installed packages.</p>
<p>When a new package is installed using <a href="pkgadd.8.html">pkgadd(8)</a>, a new record is added to the package database (stored in <i>/var/lib/pkg/db</i>). The basic package system does not have any kind of dependency checking, this will not warn you if you install a package that requires other packages to be installed. The included <a href="pkgman.1.html">pkgman(1)</a> tool (<b>pkgman</b>), however, does support dependencies.</p>
<p>The following sections will describe in short how to use the package utilities. Additional information about these utilities can be found on their respective manpage.</p>
<h2 id="Using-the-Package-System">5.2. Using the Package System</h2>
<h3 id="Installing-a-package"><b>5.2.1. Installing a package</b></h3>
<p>Installing a package is done by using <a href="pkgadd.8.html">pkgadd(8)</a>. This utility requires at least one argument, the package you want to install. Example:</p>
<pre><code># pkgadd bash#5.0.18-1.pkg.tar.gz</code></pre>
<p>When installing a package the package manager will ensure that no previously installed files are overwritten. If conflicts are found, an error message will be printed and <a href="pkgadd.8.html">pkgadd(8)</a> will abort without installing the package. The error message will contain the names of the conflicting files. Example:</p>
<pre><code># pkgadd bash#5.0.18-1.pkg.tar.gz
bin/sh
usr/share/man/man1/sh.1.gz
pkgadd error: listed files already installed
(use -f to ignore and overwrite)</code></pre>
<p>To force the installation and overwrite the conflicting files, you can use the option <b>-f</b>/<b>--force</b>. Example:</p>
<pre><code># pkgadd -f bash#5.0.18-1.pkg.tar.gz</code></pre>
<p>The package system allows a file to be owned by exactly one package. When forcing an installation the ownership of the conflicting files will be transferred to the package that is currently being installed. Directories can however be owned by more than one package.</p>
<table>
<tr>
<th>WARNING</th>
</tr>
<tr>
<td>
It is often not a good idea to force the installation
unless you really know what you are doing. If a
package conflicts with already installed files it
could be a sign that the package is broken and
installs unexpected files. Use this option with
extreme care, preferably not at all.
</td>
</tr>
</table>
<p>As earlier, the package file itself does not contain any metadata. Instead, the <a href="pkgadd.8.html">pkgadd(8)</a> uses the package filename to determine the package name and version. Thus, when installing a package file named <i>bash#5.0.18-1.pkg.tar.gz</i>, <a href="pkgadd.8.html">pkgadd(8)</a> will interpret this as a package named <i>bash</i> at version <i>5.0.18-1</i>. If <a href="pkgadd.8.html">pkgadd(8)</a> is unable to interpret the filename (e.g. <b>#</b> is missing or the filename does not end with .pkg.tar.gz) an error message will be printed and <a href="pkgadd.8.html">pkgadd(8)</a> will abort without installing the package.</p>
<h3 id="Upgrading-a-package"><b>5.2.2. Upgrading a package</b></h3>
<p>Upgrading a package is done using <a href="pkgadd.8.html">pkgadd(8)</a> with the <b>-u</b> option. Example:</p>
<pre><code># pkgadd -u bash#5.0.18-1.pkg.tar.gz</code></pre>
<p>This will replace the previously installed bash package with the new one. If you have not previously installed bash, <a href="pkgadd.8.html">pkgadd(8)</a> will print an error message. <a href="pkgadd.8.html">pkgadd(8)</a> does not care about the version number of the package in that you can "upgrade" version 2.05-1 with version 2.04-1 (or even with version 2.05-1 itself). The installed package will be replaced with the specified package.</p>
<p>Upgrading a package is equivalent to executing <a href="pkgrm.8.html">pkgrm(8)</a> followed by <a href="pkgadd.8.html">pkgadd(8)</a> with one (big) exception. When upgrading a package (with <code>pkgadd -u</code>) you have the option to prevent some of the already installed files from getting replaced. This is typically useful when you want to preserve configuration and log files.</p>
<p>When executing <a href="pkgadd.8.html">pkgadd(8)</a> the file <i>/etc/pkgadd.conf</i> will be read. This file can contain rules describing how <a href="pkgadd.8.html">pkgadd(8)</a> should behave when doing upgrades. A rule is built out of three fragments: <i>event</i>, <i>pattern</i>, and <i>action</i>. The <i>event</i> describes in what kind of situation this rule applies. Currently, only one type of event is supported, that is UPGRADE. The <i>pattern</i> is a filename pattern expressed as a regular expression and the <i>action</i> applicable to the UPGRADE event is YES or NO. More than one rule of the same event type is allowed, in which case the first rule will have the lowest priority and the last rule will have the highest priority. Example:</p>
<pre><code>#
# /etc/pkgadd.conf: pkgadd(8) configuration
#
UPGRADE ^etc/.*$ NO
UPGRADE ^var/log/.*$ NO
UPGRADE ^etc/X11/.*$ YES
UPGRADE ^etc/X11/xorg.conf$ NO
# End of file.</code></pre>
<p>The above example will cause <a href="pkgadd.8.html">pkgadd(8)</a> to never upgrade anything in <i>/etc/</i> or <i>/var/log/</i> (subdirectories included), except files in <i>/etc/X11/</i> (subdirectories included), unless it's the file <i>/etc/X11/xorg.conf</i>. The default rule is to upgrade everything, rules in this file are exceptions to that rule.</p>
<dl>
<dt id="Caution"><b>Caution</b>:</dt>
<dd>
<p>A pattern should never contain an initial "/" since you are referring to the files in the package, not the files on the disk.</p>
</dd>
</dl>
<p>See <a href="pkgadd.conf.5.html">pkgadd.conf(5)</a> for more information.</p>
<h4 id="Rejected-files"><b>5.2.2.1. Rejected files</b></h4>
<p>If <a href="pkgadd.8.html">pkgadd(8)</a> finds that a specific file should not be upgraded, it will install it under <i>/var/lib/pkg/rejected/</i>. Files in this directory are never added to the package database. The user is then free to examine, use and/or remove that file manually. Another option is to use <a href="rejmerge.8.html">rejmerge(8)</a>. For each rejected file found in <i>/var/lib/pkg/rejected/</i>, <a href="rejmerge.8.html">rejmerge(8)</a> will display the difference between the installed version and the rejected version. The user can then choose to keep the installed version, upgrade to the rejected version or perform a merge of the two. Example (using the above <i>/etc/pkgadd.conf</i>):</p>
<pre><code># pkgadd -u bash#5.0.18-1.pkg.tar.gz
pkgadd: rejecting etc/profile, keeping existing version
# tree --charset=ascii /var/lib/pkg/rejected
/var/lib/pkg/rejected
`-- etc
`-- profile</code></pre>
<h3 id="Removing-a-package"><b>5.2.3. Removing a package</b></h3>
<p>Removing a package is done by using <a href="pkgrm.8.html">pkgrm(8)</a>. This utility requires one argument, the name of the package you want to remove. Example:</p>
<pre><code># pkgrm bash</code></pre>
<table>
<tr>
<th>WARNING</th>
</tr>
<tr>
<td>
This will remove all files owned by the package, no
questions asked. Think twice before doing it and make
sure that you did not misspell the package name since
that could remove something completely different (e.g.
think about what could happen if you misspelled glib
as glibc).
</td>
</tr>
</table>
<h3 id="Querying-the-package-database"><b>5.2.4. Querying the package database</b></h3>
<p>Querying the package database is done using <a href="pkginfo.1.html">pkginfo(1)</a>. This utility has a few options to answer different queries.</p>
<table>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
<tr>
<td>-f, --footprint=FILE</td>
<td>print footprint for FILE</td>
</tr>
<tr>
<td>-i, --installed</td>
<td>list installed packages and their version</td>
</tr>
<tr>
<td>-l, --list=PACKAGE|FILE</td>
<td>list files in PACKAGE or FILE</td>
</tr>
<tr>
<td>-o, --owner=PATTERN</td>
<td>list owner(s) of file(s) matching PATTERN</td>
</tr>
<tr>
<td>-r, --root=DIR</td>
<td>specify an alternate root directory</td>
</tr>
<tr>
<td>-v, --version</td>
<td>print version and exit</td>
</tr>
<tr>
<td>-h, --help</td>
<td>print help and exit</td>
</tr>
</table>
<dl>
<dt id="List-installed-packages-and-their-version">List installed packages and their version:</dt>
<dd>
<pre><code>$ pkginfo -i
audiofile 0.2.3-1
autoconf 2.52-1
automake 1.5-1
...
xmms 1.2.7-1
zip 2.3-1
zlib 1.1.4-1</code></pre>
</dd>
<dt id="List-files-in-PACKAGE-or-FILE">List files in PACKAGE or FILE:</dt>
<dd>
<pre><code>$ pkginfo -l bash
bin/
bin/bash
etc/
etc/profile
usr/
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/bash.1.gz
$ pkginfo -l grep#2.5-1.pkg.tar.gz
usr/
usr/bin/
usr/bin/egrep
usr/bin/fgrep
usr/bin/grep
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/egrep.1.gz
usr/share/man/man1/fgrep.1.gz
usr/share/man/man1/grep.1.gz</code></pre>
</dd>
<dt id="List-owners-of-files-matching-bin-ls">List owners of files matching <i>bin/ls</i>:</dt>
<dd>
<pre><code>$ pkginfo -o bin/ls
e2fsprogs usr/bin/lsattr
fileutils bin/ls
modutils sbin/lsmod</code></pre>
</dd>
<dt id="Print-footprint-for-file">Print footprint for file:</dt>
<dd>
<pre><code>$ pkginfo -f xorg-xkill#1.0.5-1.pkg.tar.gz
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/xkill
drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/man/
drwxr-xr-x root/root usr/share/man/man1/
-rw-r--r-- root/root usr/share/man/man1/xkill.1.gz</code></pre>
<p>This feature is mainly used by <a href="pkgmk.8.html">pkgmk(8)</a> for creating and comparing footprints.</p>
</dd>
</dl>
<p>The <b>-r</b>/<b>--root</b> option should be used if you want to display information about a package that is installed on a temporarily mounted partition, which is "owned" by another system. By using this option you specify which database to use.</p>
<h2 id="Package-Management-Front-end:-pkgman">5.3. Package Management Front-end: pkgman</h2>
<p>In its current form <b>pkgutils</b> does not have a concept of dependency handling. To address this, a front-end utility called <b>pkgman</b> exists. <a href="pkgman.1.html">pkgman(1)</a> supports dependency handling (with the caveat mentioned below) as well as some overlap with <b>pkgutils</b> features.</p>
<h3 id="Functionality"><b>5.3.1. Functionality</b></h3>
<p>Some examples of pkgman's functionality and use are as follows:</p>
<dl>