Repair pkgng
Lowell Gilbert
freebsd-ports-local at be-well.ilk.org
Wed Apr 2 20:48:41 UTC 2014
Jakob Breivik Grimstveit <jakob at grimstveit.no> writes:
> 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).
That just sounds like you already were using pkgng.
> /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
> [...]
If you are missing /var/db/pkg/local.sqlite, then you've got a problem.
Double-check.
> 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
Only the database matters. I suspect that you actually have one, because
I think that portmaster must be depending on it under pkgng, so the fact
that it has a clue that you have ports installed probably means that
you're okay.
Under pkgng, a more useful way to do that second step is "pkg info | wc -l".
> How do I get myself safely over to using just pkgng, as I should on fbsd10?
I think you already are.
Start by running "pkg -N" to give the package database a check.
If it reports problems, deal with those. Otherwise, just start using the
pkg command instead of the pkg_* commands.
More information about the freebsd-ports
mailing list