Solved [solved] pkg works on server but does not work at home

Hello

I have been testing FreeBSD 9.2 installation at home, with two computers. One of them is acting as a server. PKGNG doesn't work in this environment. However, today I installed FreeBSD 9.2 onto a rented server. And in that environment, it works without any problems at all. Even without the need to install it from the ports. What is the difference that I must account for between these two environments? The home network is a Finnish ADSL from a large provider with the modem set in default settings. The server is a cheap rented server from a German data center. The pkg version at home is 2.1.7, and at the server it is 1.1.4_10. pkg hasn't worked with any version at home.
 
Re: pkg works on server but not at home

There's no version 2.1.7 of ports-mgmt/pkg, you must be confusing it with something else. The newest versions are 1.2.1 for the normal and the development version (ports-mgmt/pkg-devel).

The first thing that comes to my mind is that your modem/router's firmware doesn't handle DNS SRV records properly. Check if you can do this DNS query on your home system and it returns a list of mirror sites: dig _http._tcp.pkg.freebsd.org SRV. It should return at least:

Code:
;; ANSWER SECTION:
_http._tcp.pkg.freebsd.org.     900     IN      SRV     10 10 80 pkg0.bme.freebsd.org.
_http._tcp.pkg.freebsd.org.     900     IN      SRV     20 10 80 pkg1.nyi.freebsd.org.
_http._tcp.pkg.freebsd.org.     900     IN      SRV     50 10 80 pkg0.isc.freebsd.org.

Edit: If you now have version 1.2 installed on your home system it's very likely you can't use the official repositories until the next Wednesday when the repositories get rebuilt. Find a way of re-installing 1.1.4 on your home system for now if you already have 1.2 or later, fetching the ports tree with SVN (devel/subversion) and checking out old enough ports-mgmt/pkg subdirectory should work.
 
Re: pkg works on server but not at home

You're right. I confused the version. I did pkg version and got the 2.1.7 from bpkg. The real version with pkg -v is 1.2.1.

The response didn't have an ANSWER SECTION. The output was the following:
Code:
; <<>> DiG 9.8.4-P2 <<>> _http._tcp.pkg.freebsd.org SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5108
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;_http._tcp.pkg.freebsd.org.     IN     SRV

;; Query time: 1 msec
;; SERVER: 192.168.100.1#53(192.168.100.1)
;; WHEN: Thu Nov 28 15:29:29 2013
;; MSG SIZE  rcvd: 44
I wrote the above by hand so it might have small typos.

EDIT:
The 1.1.4 version didn't work either. In fact, I updated the version just for this post.
 
Re: pkg works on server but not at home

With 1.1.4 you should be able to get it working by putting these lines in /usr/local/etc/pkg.conf:

Code:
PACKAGESITE  :  "http://pkg0.bme.freebsd.org/${ABI}/latest"
MIRROR_TYPE : HTTP
 
Re: pkg works on server but not at home

I'm testing this now with my other FreeBSD 9.2 computer. I attempted a search for GNOME as a test. Because of the lack of a response for a long time, I interrupted the operation with Ctrl+C. And now I get the error:
Code:
# pkg search gnome
pkg: sqlite: database disk image is malformed (pkgdb.c:3069)
pkg: Unable to query repository
I suppose it may have found the address, but is there a way to fix the database?

EDIT:
I forgot to mention that in this computer pkg -v outputs 1.1.4.
 
Re: pkg works on server but not at home

There should be a file /var/db/pkg/repo-packagesite.sqlite, delete that and do pkg update again.
 
Re: pkg works on server but not at home

This worked and I installed Mercurial as a test. Thank you very much for your help. One more question, do you know if I have to repeat these steps with FreeBSD 10 when it comes out? Or is the router an issue only with FreeBSD 9.2?
 
Re: [solved] pkg works on server but not at home

From the sound of it the problem will persist because your modem/router doesn't handle SRV records properly but you can always change the mirror to a direct address and mirror type to HTTP as you now did. Be aware that in pkg version 1.2 the preferred method of specififying the repositories will change to separate configuration files under /etc/pkg and /usr/local/etc/pkg/repos directories.
 
Back
Top