Hey, just a heads-up that this content is based on an automatically imported version from our old CMS. If the formatting isn’t perfect, I’m sorry about that.

Title Image: pfSense pkg error: Shared object

The Background

Yesterday Netgate made a big leap into a new version branching for pfSense with pfSense plus. Instead of having 2.45, 2.5 versioning, there is now a partly proprietary pfSense+ build using Month/Year Versions for all Netgate-owned devices and optional bought subscriptions. The new Versions are YY.MM.VV, so 21.02 is the first one.

The Problem

On live systems, it is always a good thing to wait with a brand-new release until the first major update bugs are discovered and fixed. In pfSense, you have the ability to switch branches in the Update menu. The problem is that pfSense running on 2.4.5_1 automatically switches the branch. Of course, it will not execute the update until you hit “update,” but switching the branch already does something in the background. The new branch automatically updates the PKG Manager in FreeBSD, which, even if you do not upgrade to 2.5 or 21.02, will render your pfSense Package Manager dysfunctional. In the console, it will look like this:

Shared object "libarchive.so.7" not found, required by "pkg"

The UI Package manager just hangs endlessly in “Please wait while the update system initializes”:

Please wait while the update system initializes

The Fix

To fix the problem, you need to manually downgrade PKG in the console / SSH. First, go to your pfSense UI > System > Update; and select the Previous stable version:

pfSense UI System Update menu

Then, log in to SSH, use a shell, and issue this:

pkg-static install -f pkg

Now it will ask to downgrade the pkg manager to the previous stable version again:

pkg fix freebsd pfsense

After that, at least your pkg is working again without throwing a “Shared object “libarchive.so.7” not found, required by “pkg”” error.

Cheers