Solved pkg update error

I'm having an issue installing software on a new install of 14.2. I'm sure I've overlooked something simple. Advice please:
# pkg
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+http://pkg.FreeBSD.org/FreeBSD:14:amd64/latest, please wait...
pkg: Attempted to fetch http://pkg.FreeBSD.org/FreeBSD:14:amd64/latest/Latest/pkg.pkg
pkg: Attempted to fetch http://pkg.FreeBSD.org/FreeBSD:14:amd64/latest/Latest/pkg.txz
pkg: Error: Host does not resolve
Address resolution failed for http://pkg.FreeBSD.org/FreeBSD:14:amd64/latest.
Consider changing PACKAGESITE.

uname -a
FreeBSD pr4.blank.blank 14.2-RELEASE FreeBSD 14.2-RELEASE releng/14.2-n269506-c8918d6c7412 GENERIC amd64

cat /etc/rc.conf
hostname="pr4.blank.blank"
ifconfig_re0="inet 192.168.0.4 netmask 255.255.255.0"
defaultrouter="192.168.0.2"
sshd_enable="YES"
moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
 
First thing that comes to mind: did you try to resolve pkg.freebsd.org ?

Code:
┬─[fmc000@tu45b-freebsd:~]─[17:38:13]
╰─>$ host pkg.freebsd.org
pkg.freebsd.org is an alias for pkgmir.geo.freebsd.org.
pkgmir.geo.freebsd.org has address 85.30.190.140
pkgmir.geo.freebsd.org has address 147.28.184.43
pkgmir.geo.freebsd.org has IPv6 address 2604:1380:4091:a001::50:2
pkgmir.geo.freebsd.org has IPv6 address 2a02:80:0:3ffd::50:2
pkgmir.geo.freebsd.org mail is handled by 0 .
┬─[fmc000@tu45b-freebsd:~]─[17:39:52]
╰─>$
 
Thank you for taking the time to reply. No, there's no other software installed to try resolving pkg.freebsd.org. I can reach pkg.freebsd.org from browsers on other systems on the lan.

# host pkg.freebsd.org
;; connection timed out; no servers could be reached

I can reach the system from other systems on the lan over ssh.
 
I believe you're not connected to the LAN, try to ping another host in the LAN and to ping your host from anpther machine in the LAN.
 
I seem to be able to ping the FreeBSD system:

$ ping 192.168.0.4
PING 192.168.0.4 (192.168.0.4) 56(84) bytes of data.
64 bytes from 192.168.0.4: icmp_seq=1 ttl=64 time=0.399 ms
64 bytes from 192.168.0.4: icmp_seq=2 ttl=64 time=0.253 ms
64 bytes from 192.168.0.4: icmp_seq=3 ttl=64 time=0.249 ms
64 bytes from 192.168.0.4: icmp_seq=4 ttl=64 time=0.261 ms
64 bytes from 192.168.0.4: icmp_seq=5 ttl=64 time=0.414 ms
^C
--- 192.168.0.4 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4095ms
rtt min/avg/max/mdev = 0.249/0.315/0.414/0.074 ms

I can also ping from the FreeBSD system to other items on the lan:

# ping 192.168.0.13
PING 192.168.0.13 (192.168.0.13): 56 data bytes
64 bytes from 192.168.0.13: icmp_seq=0 ttl=255 time=134.212 ms
64 bytes from 192.168.0.13: icmp_seq=1 ttl=255 time=96.106 ms
64 bytes from 192.168.0.13: icmp_seq=2 ttl=255 time=62.251 ms
64 bytes from 192.168.0.13: icmp_seq=3 ttl=255 time=26.503 ms
64 bytes from 192.168.0.13: icmp_seq=4 ttl=255 time=46.004 ms
64 bytes from 192.168.0.13: icmp_seq=5 ttl=255 time=32.511 ms
64 bytes from 192.168.0.13: icmp_seq=6 ttl=255 time=199.865 ms
^C
--- 192.168.0.13 ping statistics ---
7 packets transmitted, 7 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 26.503/85.350/199.865/58.497 ms
 
cat /etc/nsswitch.conf
#
# nsswitch.conf(5) - name service switch configuration file
#
group: compat
group_compat: nis
hosts: files dns
netgroup: compat
networks: files
passwd: compat
passwd_compat: nis
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files
 
Back
Top