FreeBSD-update: gunzip: (stdin): unexpected end of file metadata is corrupt error

Hi,

I am trying to upgrade FreeBSD 11 to 12 but getting this error:

Fetching 1 metadata files... gunzip: (stdin): unexpected end of file metadata is corrupt.

Exact error:

The following components of FreeBSD seem to be installed:
kernel/generic kernel/generic-dbg world/base world/base-dbg world/doc
world/lib32 world/lib32-dbg

The following components of FreeBSD do not seem to be installed:

Does this look reasonable (y/n)? y

Fetching metadata signature for 12.0-RELEASE from update4.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... gunzip: (stdin): unexpected end of file
metadata is corrupt.

How to fix it?

Try deleting files.
rm -rf /var/db/freebsd-update/*
Do it again:

freebsd-update -r 12.0-RELEASE fetch

Does this help? If not edit the /etc/freebsd-update.conf and set up a new ServerName:
From:

ServerName update.FreeBSD.org

To:

ServerName update2.FreeBSD.org

Again run:

freebsd-update -r 12.0-RELEASE fetch
1 Like

Fixed it. Such weird error out of nowhere.