How to change mirror in pkg

I just installed FreeBSD and the download speeds of pkg(8) or suuuper slow. I'm searching online but I can't find any documentation. Can anyone help me?
 
Out of interest, I once read a guide that you could modify /usr/local/etc/pkg/repos/FreeBSD.conf and force a mirror through url: "pkg+http://pkg.${MIRROR}FreeBSD.org/${ABI}/latest", where MIRROR is eu., us-west., us-east., etc.

Is this still valid advice?
 
That is exactly my observation. I used eu., which is usually a bit faster than the default, however a couple of days ago, I could not connect to the server at all.
So in summary, pkg should switch automatically based on location and manually forcing a mirror could potentially break things. I will adjust my scripts.
 
Yep, you can force pkg(8) to use a specific mirror but there's no guarantee that specific mirror will be up. If you use pkg.freebsd.org this switching will happen automagically.
 
Yep, you can force pkg(8) to use a specific mirror but there's no guarantee that specific mirror will be up. If you use pkg.freebsd.org this switching will happen automagically.
Unfortunately I ended up pinning a specific mirror because whatever geo magic happened behind the scenes would consistently route me to a mirror that throttled downloads to 100 KB/s.
 
The solution I found fixes the issue, but I don't know why. I created the file /usr/local/etc/pkg/repos/FreeBSD.conf with the following line:
FreeBSD: { url: "https://pkg.freebsd.org/${ABI}/quarterly" }
 
The solution I found fixes the issue, but I don't know why. I created the file /usr/local/etc/pkg/repos/FreeBSD.conf with the following line:
FreeBSD: { url: "https://pkg.freebsd.org/${ABI}/quarterly" }
This is the default on -RELEASE versions.
 
Back
Top