Solved [SOLVED] pkg info missing installed ports (thanks, SirDice)

I must have installed a handful of ports before adding WITH_PKGNG=yes to /etc/make.conf, now portmaster -L and pkg info returns a list that's missing quite a few installed ports. How do I rectify this?
 
Re: pkg info list is missing installed ports

After installing ports-mgmt/pkg did you run pkg2ng? You should be able to run it again but it may complain there are already some packages registered. You then need to compare what's left in /var/db/pkg/ with pkg-info(8). If it exists in the new system you can safely delete the old package registration by removing the package directory in /var/db/pkg/.
 
Re: pkg info list is missing installed ports

It was a brand new 9.2-RELEASE jail, which never used pkg_. As soon as it was created I ran /usr/sbin/pkg and pkg2ng before installing any ports. I then installed mail/postfix-current and mail/dovecot2 (and their dependencies), but they don't appear in my package lists:

root@mail:~ # portmaster -L
Code:
===>>> Root ports (No dependencies, not depended on)
===>>> pkg-1.2.1
        ===>>> New version available: pkg-1.2.5
===>>> portmaster-3.17.3
===>>> 2 root ports

===>>> Trunk ports (No dependencies, are depended on)
===>>> libiconv-1.14_1
===>>> 1 trunk ports

===>>> Branch ports (Have dependencies, are depended on)
===>>> gettext-0.18.3.1
===>>> 1 branch ports

===>>> Leaf ports (Have dependencies, not depended on)
===>>> nano-2.2.6
===>>> 1 leaf ports

===>>> 5 total installed ports
        ===>>> 1 has a new version available

root@mail:~ # pkg info
Code:
gettext-0.18.3.1               GNU gettext package
libiconv-1.14_1                A character set conversion library
nano-2.2.6                     Nano's ANOther editor, an enhanced free Pico clone
pkg-1.2.5                      New generation package manager
portmaster-3.17.3              Manage your ports without external databases or languages

This is strange, after reading your post I decided to run pkg2ng:

root@mail:~ # pkg2ng
Code:
Converting packages from /var/db/pkg
Converting dialog4ports-0.1.5_2...
pkg: fopen(/usr/ports/Keywords/mtree.yaml): No such file or directory
pkg: unknown keyword mtree, ignoring @mtree
Installing dialog4ports-0.1.5_2... done
Converting perl5-5.16.3_4...
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/mtree.yaml): No such file or directory
pkg: unknown keyword mtree, ignoring @mtree
Installing perl5-5.16.3_4... done
Converting pcre-8.33...
Installing pcre-8.33... done
Converting libtool-2.4.2_2...
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
Installing libtool-2.4.2_2... done
Converting cmake-modules-2.8.12.1...
pkg: fopen(/usr/ports/Keywords/mtree.yaml): No such file or directory
pkg: unknown keyword mtree, ignoring @mtree
Installing cmake-modules-2.8.12.1... done
Converting cmake-2.8.12.1...
pkg: fopen(/usr/ports/Keywords/mtree.yaml): No such file or directory
pkg: unknown keyword mtree, ignoring @mtree
Installing cmake-2.8.12.1... done
Converting mysql55-client-5.5.34...
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
Installing mysql55-client-5.5.34... done
Converting cyrus-sasl-2.1.26_3...
pkg: fopen(/usr/ports/Keywords/display.yaml): No such file or directory
pkg: unknown keyword display, ignoring @display
pkg: fopen(/usr/ports/Keywords/mtree.yaml): No such file or directory
pkg: unknown keyword mtree, ignoring @mtree
Installing cyrus-sasl-2.1.26_3... done
Converting libspf2-1.2.10_1...
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/mtree.yaml): No such file or directory
pkg: unknown keyword mtree, ignoring @mtree
Installing libspf2-1.2.10_1... done
Converting openldap-client-2.4.38...
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/display.yaml): No such file or directory
pkg: unknown keyword display, ignoring @display
Installing openldap-client-2.4.38... done
Converting dovecot-2.2.9...
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/display.yaml): No such file or directory
pkg: unknown keyword display, ignoring @display
pkg: fopen(/usr/ports/Keywords/mtree.yaml): No such file or directory
pkg: unknown keyword mtree, ignoring @mtree
Installing dovecot-2.2.9... done
Converting postfix-current-2.11.20131001,4...
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/conflicts.yaml): No such file or directory
pkg: unknown keyword conflicts, ignoring @conflicts
pkg: fopen(/usr/ports/Keywords/display.yaml): No such file or directory
pkg: unknown keyword display, ignoring @display
Installing postfix-current-2.11.20131001,4... done
Converting pkg-1.2.5...
pkg: Unable to open plist file: %s(/var/db/pkg/pkg-1.2.5/+CONTENTS): No such file or directory
Skipping invalid package: /var/db/pkg/pkg-1.2.5

Not sure what all those errors are, but it worked:

root@mail:~ # pkg info
Code:
cmake-2.8.12.1                 Cross-platform Makefile generator
cmake-modules-2.8.12.1         Modules and Templates for CMake
cyrus-sasl-2.1.26_3            RFC 2222 SASL (Simple Authentication and Security Layer)
dialog4ports-0.1.5_2           Console Interface to configure ports
dovecot-2.2.9                  Secure and compact IMAP and POP3 servers
gettext-0.18.3.1               GNU gettext package
libiconv-1.14_1                A character set conversion library
libspf2-1.2.10_1               Sender Rewriting Scheme 2 C Implementation
libtool-2.4.2_2                Generic shared library support script
mysql55-client-5.5.34          Multithreaded SQL database (client)
nano-2.2.6                     Nano's ANOther editor, an enhanced free Pico clone
openldap-client-2.4.38         Open source LDAP client implementation
pcre-8.33                      Perl Compatible Regular Expressions library
perl5-5.16.3_4                 Practical Extraction and Report Language
pkg-1.2.5                      New generation package manager
portmaster-3.17.3              Manage your ports without external databases or languages
postfix-current-2.11.20131001,4 Secure alternative to widely-used Sendmail

Thanks (again), @SirDice. Should I be worried about those pkg2ng errors?
 
Last edited by a moderator:
Re: [SOLVED] pkg info missing installed ports (thanks, SirDi

If you install a port but forgot the add WITH_PKGNG the port will be registered with the old system, even if ports-mgmt/pkg is installed.

As for the errors, I've seen them before and they seem to be harmless. Do verify if all the old package registrations have been removed. I have had situations where the package would get registered with the new system but because of errors the old registration wasn't removed.
 
Re: [SOLVED] pkg info missing installed ports (thanks, SirDi

It looks like that's exactly what happened. pkg info lists all ports in /var/db/pkg, so do I simply rm -r /var/db/pkg? Where is the data for pkg stored?
 
Re: [SOLVED] pkg info missing installed ports (thanks, SirDi

Pkg stores it's registrations in /var/db/pkg/local.sqlite. So whatever you do, don't remove that one. Look for subdirectories in /var/db/pkg. Those are the 'old' package registrations. For each subdirectory check if the corresponding package has been registered with pkg-info(8). If it has you can remove that subdirectory. Keep doing that until there are no more subdirectories. When they're all gone a pkg_version -v shouldn't return anything any more.
 
Re: [SOLVED] pkg info missing installed ports (thanks, SirDi

Thanks, @SirDice. I've benefited so much from your help lately, I appreciate it very much.
 
Last edited by a moderator:
Back
Top