shell> mount -t ufs /dev/md0p4 /mnt
shell> ll /mnt
total 176
drwxr-xr-x 18 root wheel 512 May 12 11:58 ./
drwxr-xr-x 24 root wheel 1024 Aug 21 16:05 ../
-rw-r--r-- 2 root wheel 1023 May 12 11:45 .cshrc
-rw-r--r-- 2 root wheel 507 May 12 11:45 .profile
-r--r--r-- 1 root wheel 6109 May 12 11:58 COPYRIGHT
drwxr-xr-x 2 root wheel 1024 May 12 11:55 bin/
drwxr-xr-x 14 root wheel 1536 May 12 11:58 boot/
dr-xr-xr-x 2 root wheel 512 May 12 11:39 dev/
drwxr-xr-x 28 root wheel 2048 May 12 11:59 etc/
-rw-r--r-- 1 root wheel 0 May 12 11:59 firstboot
drwxr-xr-x 5 root wheel 2048 May 12 11:55 lib/
drwxr-xr-x 3 root wheel 512 May 12 11:55 libexec/
drwxr-xr-x 2 root wheel 512 May 12 11:39 media/
drwxr-xr-x 2 root wheel 512 May 12 11:39 mnt/
drwxr-xr-x 2 root wheel 512 May 12 11:39 net/
dr-xr-xr-x 2 root wheel 512 May 12 11:39 proc/
drwxr-xr-x 2 root wheel 2560 May 12 11:55 rescue/
drwxr-x--- 2 root wheel 512 May 12 11:58 root/
drwxr-xr-x 2 root wheel 3072 May 12 11:56 sbin/
drwxrwxrwt 2 root wheel 512 May 12 11:39 tmp/
drwxr-xr-x 14 root wheel 512 May 12 11:39 usr/
drwxr-xr-x 24 root wheel 512 May 12 11:39 var/
在指定的根目录/mnt中安装包sqlite3
shell> pkg -r /mnt install sqlite3
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100% 163 B 0.2kB/s 00:01
Fetching packagesite.pkg: 100% 6 MiB 1.7MB/s 00:04
Processing entries: 100%
FreeBSD repository update completed. 31759 packages processed.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
libedit: 3.1.20210910,1
sqlite3: 3.39.0,1
Number of packages to be installed: 2
The process will require 6 MiB more space.
1 MiB to be downloaded.
Proceed with this action? [y/N]: y
[1/2] Fetching sqlite3-3.39.0,1.pkg: 100% 1 MiB 1.4MB/s 00:01
[2/2] Fetching libedit-3.1.20210910,1.pkg: 100% 136 KiB 138.9kB/s 00:01
Checking integrity... done (0 conflicting)
[1/2] Installing libedit-3.1.20210910,1...
[1/2] Extracting libedit-3.1.20210910,1: 100%
[2/2] Installing sqlite3-3.39.0,1...
[2/2] Extracting sqlite3-3.39.0,1: 100%
查看已安装的文件
shell> for file in `pkg -r /mnt info -l sqlite3 | grep /usr/local`; do ll /mnt/$file; done
-r-xr-xr-x 1 root wheel 1727552 Aug 11 03:12 /mnt//usr/local/bin/sqldiff*
-rwxr-xr-x 1 root wheel 1960488 Aug 11 03:12 /mnt//usr/local/bin/sqlite3*
-rw-r--r-- 1 root wheel 613415 Aug 11 03:12 /mnt//usr/local/include/sqlite3.h
-rw-r--r-- 1 root wheel 37310 Aug 11 03:12 /mnt//usr/local/include/sqlite3ext.h
lrwxr-xr-x 1 root wheel 19 Aug 11 03:12 /mnt//usr/local/lib/libsqlite3.so@ -> libsqlite3.so.0.8.6
lrwxr-xr-x 1 root wheel 19 Aug 11 03:12 /mnt//usr/local/lib/libsqlite3.so.0@ -> libsqlite3.so.0.8.6
-rwxr-xr-x 1 root wheel 1750208 Aug 11 03:12 /mnt//usr/local/lib/libsqlite3.so.0.8.6*
-rw-r--r-- 1 root wheel 297 Aug 11 03:12 /mnt//usr/local/libdata/pkgconfig/sqlite3.pc
-r--r--r-- 1 root wheel 3596 Aug 11 03:12 /mnt//usr/local/man/man1/sqlite3.1.gz
-rw-r--r-- 1 root wheel 55 Aug 11 03:12 /mnt//usr/local/share/licenses/sqlite3-3.39.0,1/LICENSE
-rw-r--r-- 1 root wheel 71 Aug 11 03:12 /mnt//usr/local/share/licenses/sqlite3-3.39.0,1/PD
-rw-r--r-- 1 root wheel 180 Aug 11 03:12 /mnt//usr/local/share/licenses/sqlite3-3.39.0,1/catalog.mk
是的。这是。挂载您的自定义映像或公开可用的映像之一,并使用pkg安装软件包。使用选项
-r
。报价:笔记:
您还可以在已安装的映像上更新内核和用户空间。使用变量DESTDIR。请参阅线程Building FreeBSD 以在两个 DESTDIR 中安装或更新。
不要忘记卸载映像并销毁mdconfig 单元。
见论坛挂载镜像文件并更改内容。
选择正确的图像。请参阅有关下载 FreeBSD 的 ISO 光盘映像安装程序的论坛混淆!
例子