# Randomly unable to update pkg repository in FreeBSD 12.2 - pkgmir.geo.freebsd.org not found



## Abraham79 (Nov 10, 2020)

Since few days, pkg repository fails to update, at random. Most of the times, it works; Sometimes not. Location is India. 


```
~% doas pkg upgrade
Updating FreeBSD repository catalogue...
pkg: http://pkgmir.geo.freebsd.org/FreeBSD:12:amd64/latest/meta.txz: Not Found
repository FreeBSD has no meta file, using default settings
pkg: http://pkgmir.geo.freebsd.org/FreeBSD:12:amd64/latest/packagesite.txz: Not Found
Unable to update repository FreeBSD
Error updating repositories!
```


Here is my /usr/local/etc/pkg/repos/FreeBSD.conf

```
:~% cat /usr/local/etc/pkg/repos/FreeBSD.conf
# $FreeBSD: releng/12.2/usr.sbin/pkg/FreeBSD.conf.quarterly 346780 2019-04-27 04:00:50Z cperciva $
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#

FreeBSD: {
  #url: "pkg+http://pkg0.twn.freebsd.org/${ABI}/latest",
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
```
I tend to use the pkg0.twn.freebsd.org if it is not working. What is the recommended way? Shall I permanently add url: `"pkg+http://pkg0.twn.freebsd.org/${ABI}/latest"` ?


----------



## a6h (Nov 10, 2020)

Abraham79 said:


> I tend to use the pkg0.twn.freebsd.org if it is not working. What is the recommended way? Shall I permanently add url: `"pkg+http://pkg0.twn.freebsd.org/${ABI}/latest"` ?


pkg is already GeoIP-aware. The pkg.freebsd.org resolves/switchs to nearest one.



Abraham79 said:


> Since few days, pkg repository fails to update, at random. Most of the times, it works; Sometimes not. Location is India.


Sometime VPN is the solution!


----------



## Abraham79 (Nov 10, 2020)

vigole said:


> pkg is already GeoIP-aware. The pkg.freebsd.org resolves/switchs to nearest one.


But, I receives this error, randomly since few days. I infer that, pkg is not switching to alternate repositories.


----------



## a6h (Nov 10, 2020)

I understand. I often have the same problem. Generally I wait or ignore.


----------

