Fixing “tar: Unrecognized archive format” on FreeBSD – Causes and Quick Fix
While updating software from ports or unpacking third-party archives on a FreeBSD server, you can occasionally hit the error tar: Unrecognized archive format, causing the build to abort right after downloading the archive.

Almost every time, this comes down to one of two causes: either the downloaded file is corrupted (often an HTML 404/redirect error page saved as a tarball), or FreeBSD’s built-in bsdtar choked on an archive format or GNU-specific header that GNU tar (gtar) handles without complaint.
Step 1. Verify the Archive Is Not Corrupted First
Before changing tools, inspect the downloaded archive inside /usr/ports/distfiles/ with file:
file /usr/ports/distfiles/your_archive.tar.gz
If it reports HTML document, ASCII text, or empty, delete the broken file from /usr/ports/distfiles/, update your ports tree, and re-fetch it cleanly.
Step 2. If the Archive Is Valid, Switch to GNU tar (gtar)
When the tarball itself is intact – especially on older FreeBSD releases encountering newer compression formats or GNU tar extensions – installing gtar solves the issue right away.
The fastest route is installing the binary package:
pkg install gtar
Or building it directly from ports:
cd /usr/ports/archivers/gtar && make install clean
Next, point the ports framework to GNU tar by adding this line to /etc/make.conf:
TAR=/usr/local/bin/gtar
Finally, return to your failing port directory, clean the previous attempt, and build again:
make clean && make install clean
Once the port builds cleanly, you can either keep gtar enabled or comment out the line in /etc/make.conf to return to FreeBSD’s default bsdtar.