Solved 14.3 p5 suddenly stopped updating packages due to unknown error.

pkg update suddenly stopped working due to unknown reason.
Everything seems ok such as time, connection (no firewall)but
only pkg update doesn't work. I also tried # freebsd-update fetch, it
brought 6 lib files to be installed to upgrade it from 14.3 p5 to p6 but I didn't
farther. Later, after a reboot, I tried the same to complete the installation by using
#freebsd-update fetch and install. I didn't see installing any patch files.
The problem remains the same.
#freebsd-version -kru shows the following;
14.3-RELEASE-p5
14.3-RELEASE-p5
14.3-RELEASE-p6
and #uname -a shows the following;
FreeBSD bsd 14.3-RELEASE-p5 FreeBSD 14.3-RELEASE-p5 GENERIC amd64

Output of $ pkg update -f
Code:
$ pkg update -f
Updating FreeBSD repository catalogue...
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.conf[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.txz[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/data.pkg[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/data.tzst[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/packagesite.pkg[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/packagesite.tzst[/URL]: Not found
Unable to update repository FreeBSD
Updating FreeBSD-kmods repository catalogue...
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/meta.conf[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/meta.txz[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/data.pkg[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/data.tzst[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/packagesite.pkg[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/packagesite.tzst[/URL]: Not found
Unable to update repository FreeBSD-kmods
Error updating repositories!
I havn't deleted/changed any files/directories etc. Please let me know if you want to see any
output.
 
You may be ending up on a bad mirror, the question is which one. And I'm wondering what version of pkg(8) you have.

Code:
root@fbsd-test:~ # pkg update -f
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01
Fetching data.pkg: 100%   10 MiB   5.4MB/s    00:02
Processing entries: 100%
FreeBSD repository update completed. 36643 packages processed.
Updating FreeBSD-kmods repository catalogue...
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01
Fetching data.pkg: 100%   33 KiB  33.7kB/s    00:01
Processing entries: 100%
FreeBSD-kmods repository update completed. 214 packages processed.
All repositories are up to date.
root@fbsd-test:~ # pkg -v
2.4.2
root@fbsd-test:~ # freebsd-version
14.3-RELEASE-p5
 
You may be ending up on a bad mirror, the question is which one. And I'm wondering what version of pkg(8) you have.

Code:
root@fbsd-test:~ # pkg update -f
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01
Fetching data.pkg: 100%   10 MiB   5.4MB/s    00:02
Processing entries: 100%
FreeBSD repository update completed. 36643 packages processed.
Updating FreeBSD-kmods repository catalogue...
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01
Fetching data.pkg: 100%   33 KiB  33.7kB/s    00:01
Processing entries: 100%
FreeBSD-kmods repository update completed. 214 packages processed.
All repositories are up to date.
root@fbsd-test:~ # pkg -v
2.4.2
root@fbsd-test:~ # freebsd-version
14.3-RELEASE-p5
Sir, I've just installed pkg 2.4.2 from port but noticed existing pkg 2.4.2 was there so in reinstalled it from port but the problem remains and i think it's hanging in between p5 and p6.
An addendum; I simply typed in the command freebsd-version without -kru switches and it's showing;
$ freebsd-version
14.3-RELEASE-p6
$
Thanks as at least i see the latest upgrade but not sure it's been fully done.
 
I have same errors:

Bash:
~ $ pkg update -f
Updating FreeBSD-kmods repository catalogue...
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3/meta.conf: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3/meta.txz: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3/data.pkg: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3/data.tzst: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3/packagesite.pkg: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3/packagesite.tzst: Not found
Unable to update repository FreeBSD-kmods

Bash:
freebsd-version
14.3-RELEASE-p6

Bash:
pkg -v
2.4.2

Problem started since yesterday. I tried the link https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_latest_3, it says not found.
 
p6 was a fix for a security issue in unbound. Not related. I simply haven't installed that update. It's a non-issue for me (don't use unbound).

Some mirrors seem to work, some don't. I get 404 when I tried the files through a browser, but not on any of my 14.3 servers (different location, so GeoIP probably sends me to different mirror)
Oh! Sir, Im quite relieved now that p6 wasn't a major issue but only gripe is that there were no patch files came across and installed, only lib files. I wonder how it can be fixed and more importantly why it had been stopped or got corrupt!
 
Looks to me like a network problem - not a pkg problem. Can you download one of the URLs? You're writing here with a computer - can it reach https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.conf? And on the target machine:
fetch https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.conf
Does that work? Can you ping pkg.freebsd.org?
I got ping reply so it's ok but meta.conf not found. Network and connectivity is ok since im accessing freebsd forums from the same machine. wget is also working (for other downloads)
 
The versions you reported are correct. No problem there.
Give the result of pkg repos, it may help.
$ pkg repos
FreeBSD: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-kmods: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
$
 
I am getting the same error as OP. Nothing seems out of the ordinary with pkg.

Code:
~ pkg repos
FreeBSD: {
    url             : "pkg+[URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly[/URL]",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
FreeBSD-kmods: {
    url             : "pkg+[URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3[/URL]",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }

~ pkg -v
2.4.2

➜  ~ uname -a
FreeBSD gateway 14.3-RELEASE-p5 FreeBSD 14.3-RELEASE-p5 GENERIC amd64
➜  ~ freebsd-version -kru
14.3-RELEASE-p5
14.3-RELEASE-p5
14.3-RELEASE-p6

➜  ~ pkg upgrade
Updating FreeBSD repository catalogue...
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.conf[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.txz[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/data.pkg[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/data.tzst[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/packagesite.pkg[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/packagesite.tzst[/URL]: Not found
Unable to update repository FreeBSD
Updating FreeBSD-kmods repository catalogue...
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/meta.conf[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/meta.txz[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/data.pkg[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/data.tzst[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/packagesite.pkg[/URL]: Not found
pkg: Failed to fetch [URL]https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3/packagesite.tzst[/URL]: Not found
Unable to update repository FreeBSD-kmods
Error updating repositories!


If it matters, I am also getting this on my FreeBSD-15.0-RELEASE-amd64-ufs.vmdk virtual machine as well that was a fresh install day before yesterday, fully updated and only tried checking with it after my main on 14.3 was having troubles. Every time I try pkg update it will be very intermittent and almost always fail with maybe 1 time in few hours being able to connect.
There does seem to be something going on with being able to reach the servers, at least imo because when I try reaching:
https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.conf through the browser it fails, but with vpn it seems reachable, just through directly connecting it will 99% fail. So maybe perhaps there is an issue with my isp's routing or some other network outage somewhere on the net preventing me from reaching (that is if we assume that other people are not having this issue). I was able to reach it using US vpn but not other countries I tried. Maybe there is some other issue, I'll try to wait it out.

Note: The server is actually pingable, it's just giving me 404 on the files.
Code:
ping pkg.freebsd.org
PING pkgmir.geo.freebsd.org (203.80.16.152): 56 data bytes
64 bytes from 203.80.16.152: icmp_seq=0 ttl=57 time=24.633 ms
64 bytes from 203.80.16.152: icmp_seq=1 ttl=57 time=24.901 ms

It seems I cannot get the file from the ip 203.80.16.152 which is what my pihole/unbound (on a different machine) is resolving it to. When checking the hostname externally (through whatismyip) it gives this:
Code:
Lookup Hostname: pkg.freebsd.org
Lookup IPv4 Address: [URL='https://whatismyipaddress.com/ip/192.158.252.167']192.158.252.167[/URL]
Lookup IPv6 Address: [URL='https://whatismyipaddress.com/ip/2001:4f8:ffff:6::50:2']2001:4f8:ffff:6::50:2[/URL]

This ip I seem to be able to connect directly to and reach that file: https://203.80.16.152/FreeBSD:14:amd64/quarterly/meta.conf

So is this just a dns issue? At the very least I hope it is a clue.

Edit: I flushed network cache/restarted dns resolver on pihole, ensured it with

systemctl restart unbound.service
Then I ran another ping test:
Code:
ping pkg.freebsd.org
PING pkgmir.geo.freebsd.org (163.237.194.42): 56 data bytes
64 bytes from 163.237.194.42: icmp_seq=0 ttl=56 time=212.642 ms
64 bytes from 163.237.194.42: icmp_seq=1 ttl=56 time=213.333 ms
64 bytes from 163.237.194.42: icmp_seq=2 ttl=56 time=211.944 ms
And now I am finally able to pkg update (for now):
Code:
➜  ~ pkg update
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
When it resolves to 203.80.16.152 is when I have the problem.

Code:
dig 192.168.0.44 -p 53 pkg.freebsd.org

; <<>> DiG 9.16.50-Debian <<>> 192.168.0.44 -p 53 pkg.freebsd.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 29337
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;192.168.0.44.                  IN      A

;; AUTHORITY SECTION:
.                       86400   IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2025121102 1800 900 604800 86400

;; Query time: 24 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Fri Dec 12 07:39:01 +08 2025
;; MSG SIZE  rcvd: 116

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7844
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;pkg.freebsd.org.               IN      A

;; ANSWER SECTION:
pkg.freebsd.org.        300     IN      CNAME   pkgmir.geo.freebsd.org.
pkgmir.geo.freebsd.org. 150     IN      A       203.80.16.152

;; Query time: 456 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Fri Dec 12 07:39:02 +08 2025
;; MSG SIZE  rcvd: 85
I'm guessing it redirects me to the closest geolocated server which is pkg0.kul.freebsd.org (203.80.16.152) which doesn't seem to have anything in the /quarterly (https://pkg0.kul.freebsd.org/FreeBSD:14:amd64/quarterly) which causes the errors.
So all in all I guess my geo mirror has not yet synced/updated. I know I could pull from another server but I will wait a day or two and see if this mirror eventually updates before messing with anything.
 
Your pkg repos output seems normal to me.

I can access to https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3 with a browser from a 14.3-RELEASE without problem and pkg update does its job.

I noticed that the pkg update seems to be typed from a normal user cli ($ prefix). You must be root to use this command. That said, if you aren't, you should get "pkg: Insufficient privileges to update the repository catalogue".
I use su but prompt remains the same.
$ whoami
root

I also tried it as root million times.

$ fetch https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3
fetch: https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3: Not Found
SirDice says You may be ending up on a bad mirror, the question is which one... .
 
I got ping reply so it's ok
Mustn't be. Look at post #14. That was my thought and I tried to point you into that direction… Which IP did your ping command return? "generic retrofit" named in #14 a valid IP, I'm redirected to 85.30.190.140; You could simply do a check: Tell your system that pkg.freebsd.org should be resolved as 163.237.194.42 - therefore add to /etc/hosts:
Code:
163.237.194.42 pkg.freebsd.org
I expect it afterwards to work again. And if it works: The problem could be the routing of your network or ISP, a bad mirror, unknown stuff on the way to the pkg mirror etc.
Network and connectivity is ok since im accessing freebsd forums from the same machine.
Doesn't mean that everything is reachable.
 
Mustn't be. Look at post #14. That was my thought and I tried to point you into that direction… Which IP did your ping command return? "generic retrofit" named in #14 a valid IP, I'm redirected to 85.30.190.140; You could simply do a check: Tell your system that pkg.freebsd.org should be resolved as 163.237.194.42 - therefore add to /etc/hosts:
Code:
163.237.194.42 pkg.freebsd.org
I expect it afterwards to work again. And if it works: The problem could be the routing of your network or ISP, a bad mirror, unknown stuff on the way to the pkg mirror etc.

Doesn't mean that everything is reachable.
THANK YOU VERY VERY MUCH!! It's started working again, as usual. I've added on "163.237.194.42 pkg.freebsd.org to /etc/hosts. My problem is over and I've learnt a lot. Wishing you all the best.
 
My problem is over
Sorry to say that: It is not. Bypassing both DNS and the package mirror via /etc/hosts is not a solution, it was just a test - the entry hardly routes you to your ideal mirror, and it may already be invalid tomorrow. If we had your answer to "where does your ping go", we could check: Is it even a pkg mirror? If that's true that mirror has to be fixed. And if not, one could check whether the pkg mirror has an outdated entry. But in any case: It's just a workaround with a unknown future.
 
Sorry to say that: It is not. Bypassing both DNS and the package mirror via /etc/hosts is not a solution, it was just a test - the entry hardly routes you to your ideal mirror, and it may already be invalid tomorrow. If we had your answer to "where does your ping go", we could check: Is it even a pkg mirror? If that's true that mirror has to be fixed. And if not, one could check whether the pkg mirror has an outdated entry. But in any case: It's just a workaround with a unknown future.
It's all right and thanks for giving me a chance to let you know what I did before I add the ip to /etc/hosts. I didn't have any /usr/local/etc/pkg/repos/FreeBSD.conf, in fact I never have this file neither have I the repos dir but I came across a yt video that suggested to try fastest_pkg as it (a python script) detects the fastest pkg server and askes to create FreeBSd.conf that contains the fastest pkg server so I did what the script asked me to do but that failed too. Now, upon reading your last message about uncertain future :(, I jave just created FreeBSD.conf as the fastest_pkg wants. When I executed pkg update, I got the following;
# pkg update
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
Fetching meta.conf: 100% 179 B 0.2kB/s 00:01
Fetching data.pkg: 100% 10 MiB 203.8kB/s 00:53
Processing entries: 100%
FreeBSD repository update completed. 36643 packages processed.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
Could you please tell me why it said my previous built was from wrong packagesite and whether I did the right thing by creating FreeBSD.conf? What should I do as a precaution if pkg update fails in the near furure? Thank you.
 
Just to update my end - pkg.freebsd.org now chooses pkg0.your.freebsd.org (which works for me) and it seems pkg0.kul.freebsd.org is completely unreachable or down (from my end) so I don't know if that mirror or my isp is causing me issues (although when it was up, the /quarterly files were not available). In any case on my end the solution ended up being to wait a little bit for another mirror to come into rotation. Had it not, I would've temporarily redirected (if I was desperate) pkgmir.geo.freebsd.org to resolve to another working mirror dns - then again it was just better to leave things as is.
 
Back
Top