I'm working on FreeBSD 11 and already using programs with tcpdump as a dependency, which has libpcap and libsmi as dependencies.

I want to also install tshark, the console version of wireshark. I'll have to keep tcpdump installed though even though tshark has its own capture capability. Tshark lists libsmi as a dependency, as well as libgpg-error, libgpg-error, libgnutls, gnutls, libgcrypt, libgcrypt, libGeoIP, GeoIP, libsmi, libintl, gettext-runtime, libglib-2.0, glib20, libintl and py-pyshark, any of which might have versions installed or used. The man page also states it uses pcap, although this doesn't appear in the list on freshports.

Is there any issue or can I just pkg install tshark as usual and the OS will sort it out? For interest's sake how does FreeBSD handle this common situation?

Freshports links:   net/tcpdump,   net/tshark


Typically it will not be a problem. FreeBSD (and Unix-based operating systems in general) use dynamic linking, so multiple programs can use the same dependencies. The dependencies only need to be installed once.

As long as the packages can use the same version of the dependency, you should be fine. Occasionally there are compatibility issues when two programs require different versions of the same library, or different implementations of libraries that can't co-exist. Usually though, everything just works.

| improve this answer | |

It isn't a problem. A list of dependencies is simply that - a list of packages that a particular package needs to have installed before it will work. The ultimate dependency is that FreeBSD must be installed!

The list of dependencies exists so that pkg can install any that are not already there.

If you install package A, and it pulls in dependency B, that of course is fine. If you then install package C, that also needs B, it's already there so nothing happens (but it's still remembered by pkg).

More importantly, if you then deinstall package A, that won't deinstall package B, because package C still needs it.

This doesn't seem to be perfect (although it should be). Occasionally you end up with orphan ('leaf') packages, that aren't needed by anything (of course, sometimes you still want them). The package pkg_cutleaves is useful for cleaning these up.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.