How to fix freebsd-update no mirror problem

In my latest post about php 7 on FreeBSD 10.2 I use $5 vps/month as quick solution for my freebsd 10.2 need (the service is really good actually since I can use any *bsd by upload iso to their server). The main problem of it is freebsd-update problem where I face this error when I use freebsd-update : “No mirrors remaining, giving up”.

I don’t see that problem when I use vps but I used to see it when I try to use virtualization like virtualbox but I need it for my class. Each student must be able to update their freebsd box by their self.

Finally I got the solution 5 minutes before class start 🙂

 

Here’s what I do :

1st try

# freebsd-update fetch
Looking up update.FreeBSD.org mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from update.FreeBSD.org…

failed.
No mirrors remaining, giving up.

Try to debug it

# freebsd-update -v debug fetch
Looking up update.FreeBSD.org mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from update.FreeBSD.org…
fetch: transfer timed out
fetch: latest.ssl appears to be truncated: 0/512 bytes
failed.
No mirrors remaining, giving up.

Ok, lets try other mirror

# freebsd-update -s update1.freebsd.org fetch
Looking up update1.freebsd.org mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from update1.freebsd.org… ^C^C

I cancel it.

Another try

# dig update.freebsd.org

; <<>> DiG 9.10.3 <<>> update.freebsd.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55845
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 4, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 4096
;; QUESTION SECTION:
;update.freebsd.org. IN A

;; ANSWER SECTION:
update.freebsd.org. 600 IN CNAME update2.freebsd.org.
update.freebsd.org. 600 IN RRSIG CNAME 8 3 600 20151216041056 20151202002402 62830 freebsd.org. R7BelC6eVL6trxRLTYy6cwAkwZ7MU7gmw26K86JXDatU+KJIJYZinVpO piUNx4EvcH3Wabh8JRvamN6srkKu8KLCVgj9HxeZxIblkDYB6Un1mdg7 /EcHUgXwX7pvVsI0Fq/a6sYhV1CVDQKhzvfaFrojdix/++A+Rx0xs8LZ hFfhscuaeciHB9CDi3yMJbxAfOeThstwLGsMGj5YJQg6ilZczYyjFC8r zl8lUdm+nmv7dIRYDfIoBqkrFGRh+BeDZ62Z9eM8fnUiXfSCZlt+d+ky VhEOVPtHoHZ4CuY/rk1MZbMknQzqeeusRxVJ3cfEARj8LlsY0guHf42+ nCaVxw==
update2.freebsd.org. 600 IN A 149.20.53.26
update2.freebsd.org. 600 IN RRSIG A 8 3 600 20151225215245 20151211225100 62830 freebsd.org. M2ZMiebUvOLtjdn39lv/lv8W4HsIMIu68i0PMZR3s+WO/kspzskjF8cF OBOfsOjWYaYd6VYieO1lLRlD7IhnpczgeRvBrLEvygSXO8ngJTgKIjp8 Z3/2EC7e9t7bP0kfR66cAlhwE/sqNWqoC6EMhtbD7drqLdEXiMW8g8O3 1MoU5BnH1h/vYY3SSLxDwBUMesSxcbujHCGcrwXirTFddJdahQr27cST n33bbi1/lZJuFWYa+KwB/PCVBTyZLKFbRU4i6782Ny4E8Se95wMwGt16 UNfQUXEdPHf2MEB9ulDGWMh4yxaSbFn88qhJapbWrXkFOFbFQbp9+NRt SZsWGw==

;; AUTHORITY SECTION:
freebsd.org. 600 IN NS ns2.isc-sns.com.
freebsd.org. 600 IN NS ns3.isc-sns.info.
freebsd.org. 600 IN NS ns1.isc-sns.net.
freebsd.org. 600 IN RRSIG NS 8 2 600 20151225070650 20151211133405 62830 freebsd.org. rOyl3ZT2Enrltt6N04ypvUxqniClA5GgLHR5mDXfJ6mLPof3SQKT+HdP 6V65LB5Ws6WYwNjIznnLDJiwZkh7wkOz24CvEZorh1Ww5lkb76+cDx+e rooBYprum/lP/wPnYKmGymirWDAGn7FeILUquJv6O0JbzhfBhNva2BIz s/emqVYKJ3dTxM24Cuw3F2UDfWNOA9lrMo2DV5X1Fyw+cHqdwBtvPsQS HIOuvWtsFPzNEtnzO0DTNpdJM25pj5aikGkyw3wWvgwH8AXC8Q5lcN44 owfmSWKXvPhTiXoBQm9T9nkiVdvOLZPYJ1HAw28zfGs6sB1sweNDdmjX HQ8Cow==

;; Query time: 274 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Dec 12 17:36:15 WIB 2015
;; MSG SIZE rcvd: 1070

The precious information is answer section. freebsd-update is update2.freebsd.org.

Try use available mirror for me (in this case update2.freebsd.org)

# freebsd-update -s update2.freebsd.org fetch
Looking up update2.freebsd.org mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from update2.freebsd.org… failed.
No mirrors remaining, giving up.

Wew, fail.

Get A record of update2.freebsd.org

# dig update2.freebsd.org

; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu <<>> update2.freebsd.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13092
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;update2.freebsd.org. IN A

;; ANSWER SECTION:
update2.freebsd.org. 569 IN A 149.20.53.26

;; Query time: 58 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Sat Dec 12 10:38:46 WIB 2015
;; MSG SIZE rcvd: 53

Try again using A record of update2.freebsd.org

# freebsd-update -s 149.20.53.26 fetch
Looking up 149.20.53.26 mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from 149.20.53.26… done.
Fetching metadata index… done.
Fetching 2 metadata files… done.
Inspecting system… done.
Preparing to download files… done.
Fetching 488 patches…..10….20….30….40….50….60….70….80….90….100….110….120….130….140….150….160….170….180….190….200….210….220….230….240….250….260….270….280….290….300….310….320….330….340….350….360….370….380….390….400….410….420….430….440….450….460….470….480…. done.
Applying patches… done.
Fetching 28 files… done.

The following files will be removed as part of updating to 10.2-RELEASE-p8:
/usr/src/contrib/ntp/FREEBSD-Xlist
/usr/src/contrib/ntp/FREEBSD-upgrade
/usr/src/contrib/ntp/sntp/libevent/sample/dns-example.c
/usr/src/contrib/ntp/sntp/libevent/sample/event-read-fifo.c
/usr/src/contrib/ntp/sntp/libevent/sample/hello-world.c
/usr/src/contrib/ntp/sntp/libevent/sample/hostcheck.c
/usr/src/contrib/ntp/sntp/libevent/sample/hostcheck.h
/usr/src/contrib/ntp/sntp/libevent/sample/http-server.c
/usr/src/contrib/ntp/sntp/libevent/sample/https-client.c
/usr/src/contrib/ntp/sntp/libevent/sample/include.am
/usr/src/contrib/ntp/sntp/libevent/sample/le-proxy.c
/usr/src/contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.c
/usr/src/contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.h
/usr/src/contrib/ntp/sntp/libevent/sample/signal-test.c
/usr/src/contrib/ntp/sntp/libevent/sample/time-test.c
/usr/src/contrib/ntp/sntp/tests/fileHandlingTest.h
/usr/src/contrib/ntp/sntp/tests/g_fileHandlingTest.h
/usr/src/contrib/ntp/sntp/tests/g_networking.cpp
/usr/src/contrib/ntp/sntp/tests/g_packetHandling.cpp
/usr/src/contrib/ntp/sntp/tests/g_packetProcessing.cpp
/usr/src/contrib/ntp/sntp/tests/g_sntptest.h
/usr/src/contrib/ntp/sntp/tests_main.cpp

…………

Install update

# freebsd-update install
Installing updates… done.

Fiuh.

Conclusion :

Use A record of FreeBSD mirror update as source argument and you’ll be fine 🙂