Fix for failed pkg update

Today, I suddenly encountered an unknown error when running pkg update on FreeBSD 15.0:

Code:
Updating FreeBSD-ports repository catalogue...
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest/meta.conf: Unknown error
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest/meta.txz: Unknown error
repository FreeBSD-ports has no meta file, using default settings
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest/data.pkg: Unknown error
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest/data.tzst: Unknown error
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest/packagesite.pkg: Unknown error
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest/packagesite.tzst: Unknown error
Unable to update repository FreeBSD-ports
Error updating repositories!

And I want to share my fix below, in case you encounter similar issue.

Code:
mkdir -p /usr/local/etc/pkg/repos/ && \
cat <<'EOF' > /usr/local/etc/pkg/repos/FreeBSD.conf && pkg update
FreeBSD-ports: {
  url: "http://pkg0.your.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "none",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
FreeBSD-ports-kmods: {
  url: "http://pkg0.your.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
  mirror_type: "none",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
EOF

PS:
  • Replace pkg0.your.FreeBSD.org with a mirror URL nearest to your location. Check out the list in Other mirros section here: https://pkg.freebsd.org/
  • Note that this is only a temporary fix. Remove the file or rename its .conf extension once the original repo has come back to work for you.
 
Apart from the url settings issues, this "all-in-one-go" seems a bit specific, targeting "quarterly" users only. Applied as-is, users of a packaged base 15.0-RELEASE (who have FreeBSD-base: { enabled: yes, } in their local /usr/local/etc/pkg/repos/FreeBSD.conf) will likely be confronted with a disabled FreeBSD-base repository, that they may not be anticipating.

Edit: this is just a friendly note to users to consider before applying.
 
Apart from the url settings issues, this "all-in-one-go" seems a bit specific, targeting "quarterly" users only. Applied as-is, users of a packaged base 15.0-RELEASE (who have FreeBSD-base: { enabled: yes, } in their local /usr/local/etc/pkg/repos/FreeBSD.conf) will likely be confronted with a disabled FreeBSD-base repository, that they may not be anticipating.

Edit: this is just a friendly note to users to consider before applying.

Nice note, thanks,

Users of latest need to replace quarterly with latest.
 
SUMMARY

I'm attempting to install freebsd 15.0 on a laptop, and I'm getting a similar error message:

0. installation media tried

* https://download.freebsd.org/releas...AGES/15.0/FreeBSD-15.0-RELEASE-amd64-dvd1.iso
* https://download.freebsd.org/releas.../15.0/FreeBSD-15.0-RELEASE-amd64-memstick.img

0. host

[pre]# uname -a
FreeBSD asus 15.0-RELEASE-p1 FreeBSD 15.0-RELEASE-p1 releng/15.0-n280999-7bceec30b351 GENERIC amd64

# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=109 time=44.486 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=109 time=42.155 ms

# ifconfig
...
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=0
ether 94:08:53:70:f4:5f
inet 192.168.1.87 netmask 0xffffff00 broadcast 192.168.1.255
...[/pre]

REPRO

1. pkg update

[pre]# pkg update
Updating FreeBSD-ports repository catalogue...
pkg: No SRV record found for the repo 'FreeBSD-ports'
pkg: Failed to fetch https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/meta.conf: Could not resolve hostname
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/meta.txz -- pkg+:// implies SRV mirror type
repository FreeBSD-ports has no meta file, using default settings
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/data.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/data.tzst -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/packagesite.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/packagesite.tzst -- pkg+:// implies SRV mirror type
Unable to update repository FreeBSD-ports
Updating FreeBSD-ports-kmods repository catalogue...
pkg: No SRV record found for the repo 'FreeBSD-ports-kmods'
pkg: Failed to fetch https://pkg.freebsd.org/FreeBSD:15:amd64/kmods_quarterly_0/meta.conf: Could not resolve hostname
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/kmods_quarterly_0/meta.txz -- pkg+:// implies SRV mirror type
repository FreeBSD-ports-kmods has no meta file, using default settings
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/kmods_quarterly_0/data.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/kmods_quarterly_0/data.tzst -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/kmods_quarterly_0/packagesite.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/kmods_quarterly_0/packagesite.tzst -- pkg+:// implies SRV mirror type
Unable to update repository FreeBSD-ports-kmods
Updating FreeBSD-base repository catalogue...
pkg: No SRV record found for the repo 'FreeBSD-base'
pkg: Failed to fetch https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/meta.conf: Could not resolve hostname
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/meta.txz -- pkg+:// implies SRV mirror type
repository FreeBSD-base has no meta file, using default settings
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/data.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/data.tzst -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/packagesite.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/packagesite.tzst -- pkg+:// implies SRV mirror type
Unable to update repository FreeBSD-base
Error updating repositories![/pre]

2. pkg bootstrap -f

[pre]# pkg bootstrap -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly, please wait...
pkg: Error fetching https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/Latest/pkg.pkg: Transient resolver failure
A pre-built version of pkg could not be found for your system.
Bootstrapping pkg from pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/kmods_quarterly_0, please wait...
pkg: Error fetching https://pkg.freebsd.org/FreeBSD:15:amd64/kmods_quarterly_0/Latest/pkg.pkg: Transient resolver failure
A pre-built version of pkg could not be found for your system.[/pre]

QUESTIONS

* Why am I getting this error on a fresh installation?
* Is 15.0 not ready yet?
* Should I be using an older version?
* How do I get beyond this error?
* Should I create a bug report? (This is my first experience w/ FreeBSD and I don't know the community norms yet)

Side Question: It seems the forums do not accept markdown? Is there a markdown like syntax or a set of keybindings so that I don't have to use a mouse to click `bold` or `insert code` and all that nonsense?
 
It seems the forums do not accept markdown?
Forums typically use BBCode. We also have a couple of custom ones, for references to ports for example.

 
SirDice thx! I BBCode is new to me, and for some reason my [pre]pre[/pre] tags aren't rendering in my original post, but that's not my real issue :-)

I repro'd the same [pre]pkg: No SRV record found for the repo 'FreeBSD-ports'[/pre] issue with a fresh install of 14.3.
 
toddg FreeBSD 15.0 is alive and kicking better than previous releases.

But sometimes, https://pkg.freebsd.org behaves strangely, though, and redirects me to a farther instead of nearest pkg mirror from my location, in Indonesia, like gives me sjb (Sweden) instead of kwc or bbt (Japan).
That's why I edit my repo config above.

One thing you can check is to find the fastest pkg mirror from you:

Code:
curl -s https://pkg.freebsd.org \
| sed -En 's,.+(http://pkg0.+freebsd.org)[/"].+,\1,p' \
| xargs -n1 -P0 curl -sm1 -o /dev/null -w '%{url} %{http_code} %{time_total}\n' \
| sort -k2,3 \
| awk '$2 == 200 && !fastest {print $0, "<-- fastest"; fastest=1; next} 1'  \
| column -t
 
SUMMARY



[pre]# uname -a
FreeBSD asus 15.0-RELEASE-p1 FreeBSD 15.0-RELEASE-p1 releng/15.0-n280999-7bceec30b351 GENERIC amd64

# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=109 time=44.486 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=109 time=42.155 ms

# ifconfig
...
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=0
ether 94:08:53:70:f4:5f
inet 192.168.1.87 netmask 0xffffff00 broadcast 192.168.1.255
...[/pre]
#cat /etc/resolv.conf

nameserver 8.8.8.8
?

sysrc firewall_type
?
 
Thanks everyone. I gave up trying to install freebsd on my laptop, re-installed proxmox on it, and then installed freebsd into a VM. This works like a charm. No idea why the laptop install is giving me so many issues, everything is on the same network.
 
Fresh install of 15.0 today using the ...disc1.iso and the Tech Preview (pkgbase). After login, tried to do 'pkg update' and it fails repeatedly with (for example):

Code:
Updating FreeBSD-ports repository catalogue...
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly/meta.conf: No error
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly/meta.txz: No error
repository FreeBSD-ports has no meta file, using default settings
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly/data.pkg: No error
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly/data.tzst: No error
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly/packagesite.pkg: No error
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly/packagesite.tzst: No error
Unable to update repository FreeBSD-ports

Same result for FreeBSD-ports-kmods and FreeBSD-base.

Is this something fixable?
 
Well I'll be a monkey's uncle. You are right. I fixed up the date/time disparity (was UTC) and presto, 'pkg update' worked perfectly.

Thank you (again!!!), SirDice.

( I'm rather liking this pkgbase system)
 
Back
Top