# Can't use pkg



## kop524 (Jun 23, 2016)

Thx for answer I actually run into problem in VBox on windows host I created FreeBSD guest and when I try to install(e.g. pkg) or like `portsnap fetch` system says it can't find mirror and exits with `exit code 1` so what do I have to do to make it running with no problems???


----------



## SirDice (Jun 23, 2016)

Error code 1 is just a generic error. It doesn't tell us anything. Please post the _full_ error message.


----------



## kop524 (Jun 23, 2016)

When try to install yii package from ports folder in
	
	



```
/usr/ports
```



 





Portsnap fetch result:


 

if You need something more just let me know how to do it and You get it


----------



## SirDice (Jun 23, 2016)

"No address record" is an indication that your DNS settings are not correct.


----------



## ShelLuser (Jun 23, 2016)

Time to look into /etc/resolv.conf, optionally using drill to make sure that you can actually resolve something (see drill(1)).


----------



## kop524 (Jun 23, 2016)

Hello here is drill output:





and below 
	
	



```
drill google.ie
```
 output:


----------



## SirDice (Jun 23, 2016)

Your VM probably doesn't have a network connection or your VM is not correctly configured.


----------



## kop524 (Jun 23, 2016)

SirDice said:


> Your VM probably doesn't have a network connection or your VM is not correctly configured.



so what would be better choice??? in VBox NAT, NAT Network or Briged???


----------



## SirDice (Jun 23, 2016)

That depends on your network.


----------



## kop524 (Jun 23, 2016)

well there is actually nothing to worry about config of my network I actually have UPC 240Mb/s with no limits. computer connected vie cat6 eth cable, 2 phones via WiFi and laptop via WiFi. Everything set to auto ip via DHCP on my pc and other devices in netwk. And there is a thing that every other linux/BSD(testing out PC-BSD and FreeBSD) VM has connection.


----------



## SirDice (Jun 23, 2016)

Then it's a configuration issue on the VM itself. Does it actually have a network connection? Can you, for example, ping the default gateway? Can you ping the IP address of the DNS server? Does this server actually resolve anything?


----------



## kop524 (Jun 23, 2016)

SirDice said:


> Then it's a configuration issue on the VM itself. Does it actually have a network connection? Can you, for example, ping the default gateway? Can you ping the IP address of the DNS server? Does this server actually resolve anything?



Yeah 16 out of 16 went in no time to lo0 and I'm not sure where to find dns.Can You tell me how to get it or if `ifconfig` than which thing I should test??

EDIT: When I use `cat /etc/resolv.conf` I get:

```
nameserver 127.0.0.1
options edns0
```


----------



## SirDice (Jun 23, 2016)

kop524 said:


> Yeah 16 out of 16 went in no time to lo0


I would be seriously surprised if this wasn't the case.

https://en.wikipedia.org/wiki/Localhost


----------



## kop524 (Jun 23, 2016)

SirDice said:


> I would be seriously surprised if this wasn't the case.
> 
> https://en.wikipedia.org/wiki/Localhost


I know what localhost is but still I have problem even in briged mode of VM.


----------



## wblock@ (Jun 23, 2016)

So your VM is set up to be running its own nameserver.  Is it?  Apparently not.  Is this a preconfigured VM image, or did you set these options?  If you set them, why?


----------



## kop524 (Jun 23, 2016)

wblock@ said:


> So your VM is set up to be running its own nameserver.  Is it?  Apparently not.  Is this a preconfigured VM image, or did you set these options?  If you set them, why?


actually it was auto configured by os installer and no I actually installed it myself.


----------



## SirDice (Jun 23, 2016)

Post the following outputs:
`ifconfig`
`netstat -rn`
`cat /etc/resolv.conf`
`cat /etc/rc.conf`


----------



## wblock@ (Jun 23, 2016)

kop524 said:


> actually it was auto configured by os installer and no I actually installed it myself.


Which auto installer?  Because it is setting options that do not work by default.


----------



## kop524 (Jun 23, 2016)

@wblock I used one that is default in fbsd 10.3 and then it entered into internet settings I just used Yes to set both ipv4/v6 via DHCP/SLAAC and that is what I get after using it.


----------



## kpa (Jun 23, 2016)

Disable local_unbound in rc.conf(5) by removing the local_unbound_enable line. Then run this:

`service netif restart`.


----------



## kop524 (Jun 23, 2016)

kpa said:


> Disable local_unbound in rc.conf(5) by removing the local_unbound_enable line. Then run this:
> 
> `service netif restart`.


still "no address record" msg.


----------



## kpa (Jun 23, 2016)

Check if you have a file /etc/resolvconf.conf, remove it if found and try the service restart again.

The problem is probably local_unbound messing with the standard /etc/resolv.conf creation from the information provided from DHCP.


----------



## kop524 (Jun 23, 2016)

kpa said:


> Check if you have a file /etc/resolvconf.conf, remove it if found and try the service restart again.
> 
> The problem is probably local_unbound messing with the standard /etc/resolv.conf creation from the information provided from DHCP.


still the same  I'm really thinking about going with PC-BSD where everything work with no problem btw.


----------



## kpa (Jun 23, 2016)

Remove /etc/resolv.conf and run the service restart again, does it re-create the /etc/resolv.conf file?


----------



## kop524 (Jun 23, 2016)

kpa said:


> Remove /etc/resolv.conf and run the service restart again, does it re-create the /etc/resolv.conf file?


No it doesn't nothing appears here. Even `whereis` command doesn't find anything.


----------



## kpa (Jun 23, 2016)

Ok, you can fix the problem by entering this into a new /etc/resolv.conf file:


```
nameserver 8.8.8.8
nameserver 8.8.4.4
```

That gets you going at least.

Local_unbound should never be offered on installation, you're not the first one bitten by it.


----------



## kop524 (Jun 23, 2016)

kpa said:


> Ok, you can fix the problem by entering this into a new /etc/resolv.conf file:
> 
> 
> ```
> ...


No address record after everything told in this topic D: even Your post  And I just realized that this is Google DNS which doesn't work on any device I have when I tested.


----------



## SirDice (Jun 23, 2016)

Guys, forget about /etc/resolv.conf. If you look closely at the output from `ifconfig` you'll notice em0 doesn't have an IP address (only an IPv6 link-local address). No amount of editing /etc/resolv.conf is going to help if there's no network connectivity.


----------



## kop524 (Jun 23, 2016)

SirDice said:


> Guys, forget about /etc/resolv.conf. If you look closely at the output from `ifconfig` you'll notice em0 doesn't have an IP address (only an IPv6 link-local address). No amount of editing /etc/resolv.conf is going to help if there's no network connectivity.


thanks for pointing that I just switched back to NAT mode of VMnet and it worked fine!!


----------

