# pkg and port installation



## nedu (Oct 18, 2016)

i am a newbie to freebsd.i installed it on my system recently without partitioning to learn it using the handbook.but i just cant install any application including pkg and port-mgmt.when i tried to bootstrap the system using the command /usr/sbin/pkg, i got the error message a prebui


 t version of pkg could not be found in your system, consider changing packagesite or installing from ports. if i try to install from port, it displays the message couldnt fetch it .try to retrieve this manually into /usr/ports/distfiles and try again. i have done all i can but to no avail.i need some help please


----------



## marino (Oct 18, 2016)

you've got no network.

confirm with `ping www.google.com`
if you don't get something like 
	
	



```
PING www.google.com (216.58.194.164): 56 data bytes
64 bytes from 216.58.194.164: icmp_seq=0 ttl=52 time=57.348 ms
64 bytes from 216.58.194.164: icmp_seq=1 ttl=52 time=69.559 ms
64 bytes from 216.58.194.164: icmp_seq=2 ttl=52 time=56.908 ms
```

then you probably neglected to set up the network (e.g. DHCP) during installation.  check the handbook on how to set it up manually (or rerun post-install menu on installer which I don't know how to do on F11)


----------



## nedu (Oct 18, 2016)

Ok, would try that now.


----------



## SirDice (Oct 19, 2016)

Indeed, check you network settings. Specifically your DNS settings (resolv.conf(5)). The error "No address record" is almost always the result of not having correct DNS servers configured.


----------



## tingo (Oct 19, 2016)

FWIW, sometimes I see in FreeBSD installs that this issue pops-up: well-known servers (like portsnap.FreeBSD.org) responds with "No address record" the first time they are referenced (be it with pkg, fetch or something else). Still, the machine has a network. What always helps is to retry an operation which references the server, for example `ping portsnap.freebsd.org` - this works. After that retry your operation, and now it works.
Unfortunately, this happens so seldom that I have not yet opened a bug for it.


----------

