So, short primer:
The pkg
command installs pre-compiled packages from a FreeBSD repository.
Yes. I understood that. Yet, the Handbook does not make clear what, exactly, is the difference in the result.
These have nothing to do with the /usr/ports directory or "tree" you have on your system.
Again, this is not made clear, at least not from the discussion of the use of ports in the Handbook.
As a matter of fact, if you only use packages, you have no need of the /usr/ports files at all but they don't hurt anything, they just take up some space.
OK. I was not sure about that either, but, of course, it makes sense.
Installing from ports involves compiling each port and its dependencies. The directories for these are under /usr/ports as you have discovered. The only advantage to installing from ports is the ability to customize the options of each port. These ports compile into into a package which gets installed as such.
Well, it is the dependencies I think I am having a problem with when I install from the port: the dependencies appear to be included in the package, but are not included when installing from the port. Am I correct in this? At least this is what it appears to me when I install. For instance, I find that in order to get CUPS to work correctly, I have to install it from the package, but in order for me to get the driver for my Epson XP-830 printer I need, I have to install that from the port, since, apparently, the package does not include that particular driver.
My advice to you is to use packages if you are a new user and getting familiar with FreeBSD.
Well, I am not a new user of FreeBSD in the sense you mean. I used FreeBSD for many years when I was working at the University of Idaho. I used it to build and operate a web and e-mail server for the Department for which I was working until Computer Services finally implemented those services for the entire University. I also supported an HP-UX server. However, I was never really very good at Unix-type systems, not having enough time to devote strictly to that due to my other duties. Now I am 77, and want to get back into FreeBSD in more depth. I built and support 6 computers in our home, am not totally pleased with Windoze and am investigating using FreeBSD instead. In addition, I have been tasked by our local ham club to set up and operate some laptops for use on Field Day and for digital work. The club cannot afford to buy individual Win10 instances for their old laptops, so I am doing FreeBSD for them. So far, it is working very well.
Also, DO NOT mix ports and packages or you will/may have dependency issues.
I have worried about that...but see above.
Ports are newer than packages so a given port may depend on a newer version of a library or other dependency that the package system doesn't have available.
I had suspected that, but thank you for confirming that for me. I appreciate it.
Keep in mind there is also no need to reinstall the OS because of an issue with a package. The OS is separated from the software you install. This OS is not at all like Linux in that regard. All software in FreeBSD that is installed by the end user goes under /usr/local.
OK, That is good to know. Even so, I need the practice installing FreeBSD anyway, so I don't feel I have lost anything but a bit if time doing it the way I did.
Hope that helps. There are (extensive) threads here on using ports and packages so you should be able to find answers to any other questions you may have. If not, ask away and we'll be happy to help.
Thank you. I have also downloaded the entire Handbook, but it is HUGE, and so I am only printing off what I consider to be immediately necessary at the moment. Thank you very much for your help and advice. I very much appreciate it.
Ken Gordon