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.

 
Back
Top