Basic pkg question

I am reinstalling my system with some new configurations and am to the point where I am dropping in some basic packages to handle what I want this small server to do.
I plan on running:
Bind: so I can run a split horizon dns and manage some things from behind the firewall without resolve issues
Apache24, MySQL, Nextcloud, and Wordpress...
My question is how can I check the pkg dependencies BEFORE downloading and installing them so I can avoid dependency conflicts?
I have been crawling all over the man pages and have yet to stumble on the answer...
 
Try a "dry run", use pkg-install(8):
Code:
OPTIONS
[...]
     -n, --dry-run
		Dry-run	mode.  The list	of changes to packages is always
		printed, but no	changes	are actually made.

A few notes: there is pkg(7) that is part of the FreeBSD base system and pkg(8) that is not part of the FreeBSD base system. pkg(8) gets "bootstrapped" by the first use of pkg(7) (provided your system has internet access of course).
Because pkg has several sub-commands, the subsequent man page will be found with man pkg-<sub-command>: man pkg does not contain "everything" about "every" pkg sub-command. For installing packages: man pkg-install. Also useful is the use of pkg help and pkg help install and the likes. That same man page structure with sub-commands is applied to other commands, for example with man zfs and man zfs-create.
 
If you use only default versions of the pkg there will be no conflicts.

Here's the list of quarterly 2022q4 build: https://github.com/freebsd/freebsd-ports/blob/2022Q4/Mk/bsd.default-versions.mk
where you can lookup the default version which you can use. For example for PHP it's version 8.0 so all other pkg which depend of PHP are build against PHP8.0 if you want to use PHP8.1 you will need to switch from quarterly to latest or don't use pkg and build everything from ports.
 
Try a "dry run" …

I always use pkg upgrade --dry-run | less to check what will be upgraded.

Dry runs and less(1) are very useful, however – if I understand correctly – a dry run can not foretell conflicts and consequent deinstallations. Probably related:
From <https://github.com/freebsd/pkg/issues/231#issuecomment-319432506> summary point 3:

pkg downloads the tarball and generates a conflict warning/prompt only if the tarball contains files/directories which conflict with currently-installed packages (based on the "files" table in the local database - not available in remote database).

In today's example at <https://forums.freebsd.org/posts/647043>, conflicts did not become apparent until after the second use of --fetch-only.
 
My question is how can I check the pkg dependencies BEFORE downloading and installing them so I can avoid dependency conflicts?
As long as you stick to the same default versions there shouldn't be any conflicts with your list. So that means MySQL 8.0 and PHP 8.2 at the moment. You can change those defaults but you will have to build from ports or else you're going to have constant issues with the packages from the FreeBSD repositories.

 
Rocky Linux base is another example of a dry run not forewarning of removals until after relevant packages have been fetched.

Code:
root@mowa219-gjp4-zbook-freebsd:~ # pkg install --dry-run --repository FreeBSD-ports linux_base-rl9
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        linux_base-rl9: 9.4 [FreeBSD-ports]

Number of packages to be installed: 1

The process will require 297 MiB more space.
39 MiB to be downloaded.
root@mowa219-gjp4-zbook-freebsd:~ # time pkg install --quiet --repository FreeBSD-ports --fetch-only --yes linux_base-rl9
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
9.085u 0.448s 0:24.32 39.1%     3218+471k 530+313io 879pf+0w
root@mowa219-gjp4-zbook-freebsd:~ # pkg install --repository FreeBSD-ports --fetch-only --yes linux_base-rl9
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
All repositories are up to date.
Checking integrity... done (1 conflicting)
  - linux_base-rl9-9.4 [FreeBSD-ports] conflicts with linux_base-c7-7.9.2009_3 [installed] on /compat/linux/bin
Checking integrity... done (0 conflicting)
The following 88 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
        citrix_ica: 13.10.0
        foreign-cdm: 20231217_3
        linux-c7: 7.9.2009_1
        linux-c7-alsa-lib: 1.1.8
        linux-c7-alsa-plugins-oss: 1.1.6_4
        linux-c7-alsa-plugins-pulseaudio: 1.1.6_1
        linux-c7-alsa-utils: 1.1.8
        linux-c7-aspell: 0.60.6.1_1
        linux-c7-atk: 2.28.1_1
        linux-c7-audiofile: 0.3.6_2
        linux-c7-avahi-libs: 0.6.31_4
        linux-c7-cairo: 1.15.12_1
        linux-c7-cups-libs: 1.6.3_10
        linux-c7-curl: 7.29.0_13
        linux-c7-cyrus-sasl-lib: 2.1.26_5
        linux-c7-dbus-libs: 1.10.24_4
        linux-c7-devtools: 7.9.2009_3
        linux-c7-dri: 18.3.4_4
        linux-c7-elfutils-libelf: 0.176_2
        linux-c7-elfutils-libs: 0.176_2
        linux-c7-expat: 2.1.0_5
        linux-c7-flac-libs: 1.3.0_2
        linux-c7-fontconfig: 2.13.0
        linux-c7-freetype: 2.8_2
        linux-c7-fribidi: 1.0.2_1
        linux-c7-gdk-pixbuf2: 2.36.12
        linux-c7-glx-utils: 8.3.0_1
        linux-c7-gnutls: 3.3.29
        linux-c7-graphite2: 1.3.10
        linux-c7-gsm: 1.0.13
        linux-c7-gtk2: 2.24.31
        linux-c7-harfbuzz: 1.7.5
        linux-c7-jasper-libs: 1.900.1_5
        linux-c7-jbigkit-libs: 2.0_2
        linux-c7-jpeg: 1.2.90_4
        linux-c7-libasyncns: 0.8_1
        linux-c7-libcroco: 0.6.12_1
        linux-c7-libdrm: 2.4.97
        linux-c7-libgcrypt: 1.5.3_4
        linux-c7-libgfortran: 4.8.5_6
        linux-c7-libglade2: 2.6.4_1
        linux-c7-libglvnd: 1.0.1
        linux-c7-libgpg-error: 1.12_2
        linux-c7-libogg: 1.3.0_1
        linux-c7-libpciaccess: 0.14
        linux-c7-libpng: 1.5.13_3
        linux-c7-librsvg2: 2.40.20
        linux-c7-libsigc++20: 2.10.0
        linux-c7-libsndfile: 1.0.25_7
        linux-c7-libssh2: 1.8.0_2
        linux-c7-libtasn1: 4.10
        linux-c7-libthai: 0.1.14_1
        linux-c7-libtheora: 1.1.1_1
        linux-c7-libtiff: 4.0.3_5
        linux-c7-libv4l: 0.9.5_2
        linux-c7-libvorbis: 1.3.3_2
        linux-c7-libxml2: 2.9.1_4
        linux-c7-lz4: 1.8.3
        linux-c7-motif: 2.3.4_6
        linux-c7-nettle: 2.7.1_1
        linux-c7-nspr: 4.35.0
        linux-c7-nss: 3.90.0
        linux-c7-openal-soft: 1.16.0_3
        linux-c7-openldap: 2.4.44_3
        linux-c7-p11-kit: 0.23.5_1
        linux-c7-pango: 1.42.4_1
        linux-c7-pixman: 0.34.0
        linux-c7-pulseaudio-libs: 10.0_3
        linux-c7-pulseaudio-utils: 10.0_2
        linux-c7-qt: 4.8.7_4
        linux-c7-qt-x11: 4.8.7_4
        linux-c7-qtwebkit: 2.3.4_2
        linux-c7-sdl: 1.2.15_3
        linux-c7-sdl20: 2.0.14
        linux-c7-sdl_image: 1.2.12_2
        linux-c7-sdl_mixer: 1.2.12_1
        linux-c7-sdl_ttf: 2.0.11_2
        linux-c7-sqlite: 3.7.17_2
        linux-c7-systemd-libs: 219_13
        linux-c7-tcl85: 8.5.13_1
        linux-c7-tcp_wrappers-libs: 7.6_2
        linux-c7-tk85: 8.5.13_1
        linux-c7-trousers: 0.3.14_1
        linux-c7-wayland: 1.15.0
        linux-c7-xorg-libs: 7.7_11
        linux-nvidia-libs-470: 470.161.03
        linux_base-c7: 7.9.2009_3

New packages to be INSTALLED:
        linux_base-rl9: 9.4 [FreeBSD-ports]

Number of packages to be removed: 87
Number of packages to be installed: 1

The operation will free 1 GiB.
root@mowa219-gjp4-zbook-freebsd:~ # pkg install --dry-run --repository FreeBSD-ports linux_base-rl9
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
All repositories are up to date.
Checking integrity... done (1 conflicting)
  - linux_base-rl9-9.4 [FreeBSD-ports] conflicts with linux_base-c7-7.9.2009_3 [installed] on /compat/linux/bin
Checking integrity... done (0 conflicting)
The following 88 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
        citrix_ica: 13.10.0
        foreign-cdm: 20231217_3
        linux-c7: 7.9.2009_1
        linux-c7-alsa-lib: 1.1.8
        linux-c7-alsa-plugins-oss: 1.1.6_4
        linux-c7-alsa-plugins-pulseaudio: 1.1.6_1
        linux-c7-alsa-utils: 1.1.8
        linux-c7-aspell: 0.60.6.1_1
        linux-c7-atk: 2.28.1_1
        linux-c7-audiofile: 0.3.6_2
        linux-c7-avahi-libs: 0.6.31_4
        linux-c7-cairo: 1.15.12_1
        linux-c7-cups-libs: 1.6.3_10
        linux-c7-curl: 7.29.0_13
        linux-c7-cyrus-sasl-lib: 2.1.26_5
        linux-c7-dbus-libs: 1.10.24_4
        linux-c7-devtools: 7.9.2009_3
        linux-c7-dri: 18.3.4_4
        linux-c7-elfutils-libelf: 0.176_2
        linux-c7-elfutils-libs: 0.176_2
        linux-c7-expat: 2.1.0_5
        linux-c7-flac-libs: 1.3.0_2
        linux-c7-fontconfig: 2.13.0
        linux-c7-freetype: 2.8_2
        linux-c7-fribidi: 1.0.2_1
        linux-c7-gdk-pixbuf2: 2.36.12
        linux-c7-glx-utils: 8.3.0_1
        linux-c7-gnutls: 3.3.29
        linux-c7-graphite2: 1.3.10
        linux-c7-gsm: 1.0.13
        linux-c7-gtk2: 2.24.31
        linux-c7-harfbuzz: 1.7.5
        linux-c7-jasper-libs: 1.900.1_5
        linux-c7-jbigkit-libs: 2.0_2
        linux-c7-jpeg: 1.2.90_4
        linux-c7-libasyncns: 0.8_1
        linux-c7-libcroco: 0.6.12_1
        linux-c7-libdrm: 2.4.97
        linux-c7-libgcrypt: 1.5.3_4
        linux-c7-libgfortran: 4.8.5_6
        linux-c7-libglade2: 2.6.4_1
        linux-c7-libglvnd: 1.0.1
        linux-c7-libgpg-error: 1.12_2
        linux-c7-libogg: 1.3.0_1
        linux-c7-libpciaccess: 0.14
        linux-c7-libpng: 1.5.13_3
        linux-c7-librsvg2: 2.40.20
        linux-c7-libsigc++20: 2.10.0
        linux-c7-libsndfile: 1.0.25_7
        linux-c7-libssh2: 1.8.0_2
        linux-c7-libtasn1: 4.10
        linux-c7-libthai: 0.1.14_1
        linux-c7-libtheora: 1.1.1_1
        linux-c7-libtiff: 4.0.3_5
        linux-c7-libv4l: 0.9.5_2
        linux-c7-libvorbis: 1.3.3_2
        linux-c7-libxml2: 2.9.1_4
        linux-c7-lz4: 1.8.3
        linux-c7-motif: 2.3.4_6
        linux-c7-nettle: 2.7.1_1
        linux-c7-nspr: 4.35.0
        linux-c7-nss: 3.90.0
        linux-c7-openal-soft: 1.16.0_3
        linux-c7-openldap: 2.4.44_3
        linux-c7-p11-kit: 0.23.5_1
        linux-c7-pango: 1.42.4_1
        linux-c7-pixman: 0.34.0
        linux-c7-pulseaudio-libs: 10.0_3
        linux-c7-pulseaudio-utils: 10.0_2
        linux-c7-qt: 4.8.7_4
        linux-c7-qt-x11: 4.8.7_4
        linux-c7-qtwebkit: 2.3.4_2
        linux-c7-sdl: 1.2.15_3
        linux-c7-sdl20: 2.0.14
        linux-c7-sdl_image: 1.2.12_2
        linux-c7-sdl_mixer: 1.2.12_1
        linux-c7-sdl_ttf: 2.0.11_2
        linux-c7-sqlite: 3.7.17_2
        linux-c7-systemd-libs: 219_13
        linux-c7-tcl85: 8.5.13_1
        linux-c7-tcp_wrappers-libs: 7.6_2
        linux-c7-tk85: 8.5.13_1
        linux-c7-trousers: 0.3.14_1
        linux-c7-wayland: 1.15.0
        linux-c7-xorg-libs: 7.7_11
        linux-nvidia-libs-470: 470.161.03
        linux_base-c7: 7.9.2009_3

New packages to be INSTALLED:
        linux_base-rl9: 9.4 [FreeBSD-ports]

Number of packages to be removed: 87
Number of packages to be installed: 1

The operation will free 1 GiB.
root@mowa219-gjp4-zbook-freebsd:~ #
 
Back
Top