Solved Pkg repository error

Gray Jack

New Member

Reaction score: 10
Messages: 17

After finishing installing freeBSD 11.1 on a laptop, when I try using pkg install or pkg update I'm getting the following error:
Code:
pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory
pkg: http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly/meta.txz: No address record
repository FreeBSD has no meta file, using default settings
pkg: http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly/packagesite.txz: No address record
Unable to update repository FreeBSD
Error updating repositories!

I searched about this error, and a few people had this error cause they were not connected in the internet. So I made sure that I was connected, and I'm connected and still getting this error.

The thing is that pkg was working properly after the install, before the reboot, just after the reboot that I got this error.

Oh! And I still don't configured any firewall.

How do I fix it?

If more info are needed, just let me know the command that I need to use.

Thanks
 
Last edited by a moderator:

ShelLuser

Son of Beastie

Reaction score: 2,123
Messages: 3,797

First be sure if that file really isn't there. I also saw this error pop up on my system one day but the file was there so I ignored it, and eventually so did the system because now there are no further complaints.
 
OP
G

Gray Jack

New Member

Reaction score: 10
Messages: 17

First be sure if that file really isn't there. I also saw this error pop up on my system one day but the file was there so I ignored it, and eventually so did the system because now there are no further complaints.

There is 2 files, a FreeBSD.meta and a local.sqlite, but the error said about a repo-FreeBSD.sqlite
 

acheron

Aspiring Daemon
Developer

Reaction score: 344
Messages: 797

It means your resolver is not set up correctly, can you post the content of /etc/resolv.conf and the result of netstat -rn.
 
OP
G

Gray Jack

New Member

Reaction score: 10
Messages: 17

It means your resolver is not set up correctly, can you post the content of /etc/resolv.conf and the result of netstat -rn.

Oh! It was the resolv.conf!! for some reason after install reboot, the correct nameserver was commented and a new trash one was set for some reason.
/etc/resolv.conf

# Generated by resolvconf
search HGW-2501GNP-RC
# nameserver 192.168.1.1

nameserver 127.0.0.1
options ends0


Thanks a lot, now it's working properly
 

decuser

Well-Known Member

Reaction score: 139
Messages: 303

Ran into this in FreeBSD 13, just did: local-unbound-setup 208.67.222.222 208.67.220.220 seemed to work.
 
Top