# pkgng refuses repository made with poudriere-devel



## marwis (Sep 7, 2013)

I use ports-mgmt/poudriere-devel to build a pkgng repository that contains (for now) a single package net/openntpd.  I made the repository available to the clients using www/publicfile.

I set up the client machine to use the repository.

```
$ cat /usr/local/etc/pkg.conf
# System-wide configuration file for pkg(1)
# For more information on the file format and
# options please refer to the pkg.conf(5) man page

# Configuration options
PACKAGESITE	    : http://192.168.0.194/release91amd64-default
#PKG_DBDIR	    : /var/db/pkg
#PKG_CACHEDIR	    : /var/cache/pkg
#PORTSDIR	    : /usr/ports
#PUBKEY		    : /etc/ssl/pkg.conf
#HANDLE_RC_SCRIPTS   : NO
#PKG_MULTIREPOS	    : NO
#ASSUME_ALWAYS_YES   : NO
#SYSLOG		    : YES
#SHLIBS		    : NO
#AUTODEPS	    : NO
#PORTAUDIT_SITE	    : http://portaudit.FreeBSD.org/auditfile.tbz

# Repository definitions
#repos:
#  default : http://example.org/pkgng/
#  repo1 : http://somewhere.org/pkgng/repo1/
#  repo2 : http://somewhere.org/pkgng/repo2/
```

The repository is refused by pkg, while the webserver log shows repo.txz was successfully fetched.

```
# pkg update
Updating repository catalogue
pkg: Archive file does not have repo.sqlite file
```

However, if I download the repo.txz manualy and inspect it, it seems to contain what's needed.

```
[CMD=#]fetch http://192.168.0.194/release91amd64-default/repo.txz[/CMD]
fetch: [url]http://192.168.0.194/release91amd64-default/repo.txz:[/url] size of remote file is not known
repo.txz                                              1772  B 8091 kBps
[CMD=#]tar -xf repo.txz[/CMD]
[CMD=#]sqlite3 repo.sqlite[/CMD]
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> [CMD]select * from packages;[/CMD]
1|net/openntpd|openntpd|4.6_2,2|OpenBSD's Network Time Protocol daemon|OpenBSD's ntpd.

The ntpd daemon implements the Simple Network Time Protocol version 4 as
described in RFC 2030 and the Network Time Protocol version 3 as de-
scribed in RFC 1305.  It can synchronize the local clock to one or more
remote NTP servers and act as NTP server itself, redistributing the local
time.

WWW: [url]http://www.openntpd.org/||freebsd:9:x86:64|naddy@FreeBSD.org|http://www.openntpd.org/|/usr/local|28396|57762|1|666717e83260d0e9498f26d09986ff1c0c8bc18bb7b6c083cffdc62df156b111|All/openntpd-4.6_2,2.txz|[/url]
2|ports-mgmt/pkg|pkg|1.1.4_2|New generation package manager|New Generation package management tool for FreeBSD

WWW: [url]http://wiki.freebsd.org/pkgng||freebsd:9:x86:64|portmgr@FreeBSD.org|http://wiki.freebsd.org/pkgng|/usr/local|1684720|6067725|1|466f9a84ba9afc8b014fff5ea78301ecff6d8dc4cf3065327c6cb8c358396b64|All/pkg-1.1.4_2.txz|[/url]
sqlite> [CMD].exit[/CMD]
```

Both machines are running 9.1-RELEASE.  ports-mgmt/poudriere-devel uses ZFS with no trouble and is at latest version 3.0.99.20130906.  The same problem occurs with 3.0.99.20130721, however.

I'd appreciate any hints.  Thanks!


----------



## kpa (Sep 7, 2013)

Most likely you have different versions of the ports-mgmt/pkg in the build host and the client machine. Make sure both are 1.1.4_2 (or later).


----------



## marwis (Sep 7, 2013)

You're right!  After updating ports-mgmt/pkg from ports to the latest and *the same* version, the client is now able to use the repository.

```
# pkg update
Updating repository catalogue
Incremental update completed, 0 packages processed:
0 packages updated, 0 removed and 0 added.
```

Thank you! :beer  It took you several minutes to figure out what I couldn't do in several days.


----------



## marwis (Sep 20, 2013)

For the record: the choice of www/publicfile as a webserver wasn't really good.  It was possible to manually fetch(1) the repository files, however `pkg update` failed.  If www/squid was put in the middle as a proxy, `pkg update` started working.  This wasn't an acceptable solution, however.

Using www/mathopd as the webserver works fine.


----------

