Solved pkg: Repository FreeBSD-ports cannot be opened. 'pkg update' required

I'm running FreeBSD 15.1-RELEASE (p3) on aarch64, and use the latest packages. This was working fine until today, when I tried to upgrade my packages with pkg upgrade -y when I got the message that pkg: Repository FreeBSD-ports-kmods has a wrong packagesite, need to re-create database and refused to upgrade the packages. I was also unable to install new packages due to the same error.

I have attached my usual /usr/local/etc/pkg/repos/FreeBSD.conf, but it is identical to /etc/pkg/FreeBSD.conf with quarterly replaced with latest. It had been working fine since I upgraded from FreeBSD 14 to 15 in October last year.

Not knowing what to do, I saved the output of pkg info, and decided to remove my pkg database and reinstall my packages, including recreating /usr/local/etc/pkg/repos/FreeBSD.conf just in case. However, this did not fix it, and now I get a pkg: Repository FreeBSD-ports cannot be opened. 'pkg update' required error instead (and pkg update does not resolve it).

Here is the output of my attempt:

Code:
# pkg delete -afy
# rm -rf /var/db/pkg
# rm /usr/local/etc/pkg/repos/FreeBSD.conf
# awk '{gsub(/quarterly/,"latest"); print}' /etc/pkg/FreeBSD.conf > /usr/local/etc/pkg/repos/FreeBSD.conf
# pkg install tmux
Updating FreeBSD-ports repository catalogue...
Fetching meta.conf: 100%     168 B   0.2 kB/s    00:01
Fetching data: 100%  9167 KiB   2.4 MB/s    00:04
pkg: repository archive entry is too large: data
pkg: No signature found
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
Fetching meta.conf: 100%     179 B   0.2 kB/s    00:01
Fetching data: 100%    17 KiB  17.5 kB/s    00:01
Processing entries: 100%
FreeBSD-ports-kmods repository update completed. 80 packages processed.
All repositories are up to date.
pkg: Repository FreeBSD-ports cannot be opened. 'pkg update' required
pkg: No packages available to install matching 'tmux' have been found in the repositories

# pkg update
Updating FreeBSD-ports repository catalogue...
Fetching meta.conf: 100%     168 B   0.2 kB/s    00:01
Fetching data: 100%  9167 KiB   1.9 MB/s    00:05
pkg: repository archive entry is too large: data
pkg: No signature found
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.

# pkg install tmux
Updating FreeBSD-ports repository catalogue...
Fetching meta.conf: 100%     168 B   0.2 kB/s    00:01
Fetching data: 100%  9167 KiB   1.9 MB/s    00:05
pkg: repository archive entry is too large: data
pkg: No signature found
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.
pkg: Repository FreeBSD-ports cannot be opened. 'pkg update' required
pkg: No packages available to install matching 'tmux' have been found in the repositories

As you can see, two of the errors match those in this thread:

Code:
pkg: repository archive entry is too large: data
pkg: No signature found

However, my FreeBSD.conf seems fine.

If I remove /var/db/pkg and /usr/local/etc/pkg/repos/FreeBSD.conf, I can install quarterly packages, so it doesn't make sense to me that the rest of the packages site wouldn't be accessible to pkg, especially as I can browse the site in my web browser on another machine on the LAN.

I have even tried removing /usr/local/sbin/pkg, and running pkg bootstrap again, but nothing changes.

Does anyone know what is going on? Could it be related to the other thread? Is there something I missed when removing the old pkg database?
 

Attachments

Maybe the problem is that you have FreeBSD.conf repository config configured twice in both /etc/ and /usr/local.

Maybe only edit /etc/pkg/FreeBSD.conf to use latest.
 
Maybe the problem is that you have FreeBSD.conf repository config configured twice in both /etc/ and /usr/local.

Maybe only edit /etc/pkg/FreeBSD.conf to use latest.
Thank you for your reply. As far as I know, you are not supposed to edit the original versions of these configuration files, as they can be clobbered by future updates. The /usr/local/etc/pkg/repos/FreeBSD.conf location is checked first, and overrides the version in the default location. This method has been working for years, so I'm not sure why it would suddenly stop, unless something in the p3 update broke it?
 
try using another pkg mirror like pkg0.ovh.freebsd.org.
i did rm /var/db/pkg/repos/FreeBSD-ports/* and then pkg update and it recreated it
then updated a package and it worked

[root@instance-20260827-1504 ~]# freebsd-version -kur
15.1-RELEASE-p3
15.1-RELEASE-p3
15.1-RELEASE-p3
[root@instance-20260827-1504 ~]# uname -a
FreeBSD instance-20260827-1504 15.1-RELEASE-p3 FreeBSD 15.1-RELEASE-p3 releng/15.1-n283611-88e7371d9dc2 GENERIC arm64
 
try using another pkg mirror like pkg0.ovh.freebsd.org.
i did rm /var/db/pkg/repos/FreeBSD-ports/* and then pkg update and it recreated it
then updated a package and it worked
Thanks for the suggestion, but I'm not sure how to do that. I tried changing all references to pkg.FreeBSD.org in /usr/local/etc/pkg/repos/FreeBSD.conf to pkg0.ovh.freebsd.org, but I just got a lot of errors when I ran pkg upgrade.

Code:
# pkg upgrade
Updating FreeBSD-ports repository catalogue...
pkg: SRV lookup failed for '_https._tcp.pkg0.ovh.freebsd.org', falling back to https://pkg0.ovh.freebsd.org
SSL certificate subject does not match host pkg0.ovh.freebsd.org
SSL certificate subject does not match host pkg0.ovh.freebsd.org
SSL certificate subject does not match host pkg0.ovh.freebsd.org
pkg: SRV lookup failed for '_https._tcp.pkg0.ovh.freebsd.org', falling back to https://pkg0.ovh.freebsd.org

I checked the man page for pkg.conf, and it seems like I'm doing the right thing. Is there a list of pkg mirror sites somewhere?

I also checked the handbook, but couldn't find anything useful.

I am really curious to know why this issue seems to be "picking on" arm64 users. I know it's small sample size, but you are running arm64 too, as well as the user in the other thread. I've got two amd64 machines on the same network and they work fine with the same FreeBSD.conf.

I wonder if it's worth reopening Bug 297548 which was apparently an infrastructure issue. No idea why it would target arm64 users though.
 
Okay, mystery solved, and the answer was in Bug 297548:

Gennady Proskurin 2026-08-19 20:04:44 UTC

What is the amount of free space in your temporary directory (I believe it is /tmp by default)? Try to set TMPDIR to directory where you have more space and test again.

My /tmp is using a tmpfs of 75MB, and the download was more than this. Setting TMPDIR to another location fixes the issue.

The reason the issue "picks on" arm64 users is because we use tmpfs to save writes to flash media and, as we have limited RAM, we set this value quite low - when you have a 4GB machine running several jails, their tmp mounts all add up.

Thanks to everyone for their input. Marking this as solved.
 
Back
Top