Repair pkgng

Kevin Oberman rkoberman at gmail.com
Wed Apr 2 23:00:41 UTC 2014


On Wed, Apr 2, 2014 at 5:27 AM, Jakob Breivik Grimstveit <
jakob at grimstveit.no> wrote:

> Hi,
>
> After having done some half-hearted pkgng conversions back in the fbsd 9.x
> days I'm now on fbsd 10.
>
> I use `portmaster -a -v -d --delete-packages` to upgrade packages
>
> Trying to convert to new pkg format fails:
>
> # pkg2ng
> Converting packages from /var/db/pkg
> [...]
> Converting libyaml-0.1.6...
> pkg: Unable to open plist file: /var/db/pkg/libyaml-0.1.6/+CONTENTS
> Skipping invalid package: /var/db/pkg/libyaml-0.1.6
> Converting gcc-ecj-4.5...
> pkg: Unable to open plist file: /var/db/pkg/gcc-ecj-4.5/+CONTENTS
> Skipping invalid package: /var/db/pkg/gcc-ecj-4.5
> Converting cmake-modules-2.8.10.2...
> pkg: Unable to open plist file:
> /var/db/pkg/cmake-modules-2.8.10.2/+CONTENTS
> Skipping invalid package: /var/db/pkg/cmake-modules-2.8.10.2
> [...]
> Analysing shared libraries, this will take a while... done
>
> These lines I get for every installed package (I assume).
>
> /etc/make.conf contains WITH_PKGNG=YES
>
> /var/db/pkg only contains these files:
>
> $ find /var/db/pkg
> [...]
> /var/db/pkg/libyaml-0.1.6
> /var/db/pkg/libyaml-0.1.6/distfiles
> /var/db/pkg/gcc-ecj-4.5
> /var/db/pkg/gcc-ecj-4.5/distfiles
> /var/db/pkg/cmake-modules-2.8.10.2
> /var/db/pkg/cmake-modules-2.8.10.2/distfiles
> [...]
>
> portmaster -l and /contents of /var/db/pkg are also different (not very
> strange, I assume):
>
> $ portmaster -l | wc -l && find /var/db/pkg -type d -maxdepth 1|wc -l
>      206
>      267
>
>
> How do I get myself safely over to using just pkgng, as I should on fbsd10?
>
>
> --
> Vyrdsamt,
>     Jakob Breivik Grimstveit | +47 4829 8152
>     http://grimstveit.no/jakob
> _______________________________________________
> freebsd-ports at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at freebsd.org"
>

Jakob,

The single most significant aspect of pkgng is probably the move from the
old ASCII DB (/var/db/pkg) to an sqlite DB. The old flat DB is left, but is
not longer updated.

Your best bet is to learn the appropriate commands in pkg. Start with "pkg
help info". For te most part, portmaster is unchanged including portmaster
-l. Among the changes you might notice is speed. Most operations are much
faster. E.g. "pkg version -Ivl\<" is vastly faster than the old
"pkg_version -vl\<" or even "portversion -vl\<" to list ports that have
been updated. (Note the new "-I" option to use the index file. Without it,
it is still pretty slow, but you need to either build or fetch the index
for '-I' to work.)

You can pretty much do anything with pkgng that you could do with with the
old system, most commands are the same with the removal of the '_' after
"pkg", but new functionality do require a few changes plus there are a lot
of new capabilities afforded by using a real DB that can be very nice.

The one things most notably missing is clean handling of things like moves
of ports or refactoring of ports. These will often need the use f"pkg set
-o" to change the origin manually, but this is very fast as, unlike the old
system, where changing he origin required re-installation. And this should
be fixed when the new solver is added to pkg. It is currently in alpha, so
it may be a while. It really has to work right to avoid disaster with the
data, but once it is solid and fully tested, pkgng should be a huge win.
-- 
R. Kevin Oberman, Network Engineer, Retired
E-mail: rkoberman at gmail.c <rkoberman at gmail.com>


More information about the freebsd-ports mailing list