Big trouble since upgrading to PKGNG

Hi folks,

I'm not an experienced user of FreeBSD, but portmaster was almost always working fine for me. Some days ago, I found a message in one of the ports messages that I should upgrade pkg to PKGNG, so I followed the steps and did it. Since then I'm constantly getting messages like for example:
Code:
pkg_info: the package info for package 'perl5-5.16.3_4' is corrupt
(yesterday I had to manually rebuild around fifteen ports because of these messages). Now I'm unable to update my ports, because help2man is asking me to rebuild all p5-* ports (according to UPDATING, since Perl5 paths changed). I'm getting this error:

Code:
[myso@pha /usr/ports/lang/perl5.16]$ sudo portmaster -r perl
        ===>>> No ORIGIN in /var/db/pkg/perl5-5.16.3_4/+CONTENTS


===>>> Working on:
        perl5-5.16.3_4

===>>> Gathering distinfo list for installed ports

        ===>>> No ORIGIN in /var/db/pkg/perl5-5.16.3_4/+CONTENTS


===>>> perl5-5.16.3_4 1/1
        ===>>> No ORIGIN in /var/db/pkg/perl5-5.16.3_4/+CONTENTS


===>>> Cannot continue
===>>> Aborting update

===>>> Update for perl5-5.16.3_4 failed
===>>> Aborting update

===>>> Killing background jobs
Terminated
===>>> Exiting

What have I messed up by upgrading to PKGNG? Thanks and sorry for being a noob ;)
 
myso said:
Some days ago, I found a message in one of the ports messages that I should upgrade pkg to PKGNG, so I followed the steps and did it.
Which makes me wonder which FreeBSD version you're using? I'm also using the ports collection and quite frankly I don't recall seeing such a message appear. The implementation of pkgng is something which is scheduled to be done with FreeBSD 10 as far as I know.

Then there's another issue; if you switched to using the new pkgng environment you should not be using the old tools. So I don't know when you get to see the pkg_info message which you showed above, but that is a clear sign that something didn't go right with your conversion to the new packaging environment.

Which steps did you follow for this conversion?
 
Hi, thanks for your replies in such a short notice. I'll try to give you as much information as possible.
Rulus said:
Did you do run pkg2ng? Also, did you add
Code:
WITH_PKGNG="yes"
to your make.conf? You seem to be using pkg instead of pkgng.
Code:
[myso@pha /usr/ports/lang/perl5.16]$ cat /etc/make.conf
.include "/usr/local/etc/ports_sites.conf"
#FORCE_PKG_REGISTER=YES
WITH_PKGNG=yes
ShelLuser said:
Which makes me wonder which FreeBSD version you're using?
Code:
[myso@pha /usr/ports/lang/perl5.16]$ uname -a
FreeBSD pha.myso.vizvaz.com 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013     root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
ShelLuser said:
I'm also using the ports collection and quite frankly I don't recall seeing such a message appear. The implementation of pkgng is something which is scheduled to be done with FreeBSD 10 as far as I know.
I saw the message after upgrading my ports with Portmaster, to be specific I think it was the Portmaster port.
ShelLuser said:
So I don't know when you get to see the pkg_info message which you showed above, but that is a clear sign that something didn't go right with your conversion to the new packaging environment.
For example (shortened):
Code:
[myso@pha /usr/ports/lang/perl5.16]$ sudo portmaster --check-depends
===>>> Checking ORBit2-2.14.19
pkg_info: the package info for package 'perl5-5.16.3_4' is corrupt

        ===>>> lang/perl5.16 is listed as a dependency
        ===>>> but there is no installed version

        ===>>> Delete this dependency data? y/n [n]
ShelLuser said:
Which steps did you follow for this conversion?
This is what I did at first:
/usr/ports/UPDATING said:
20121015:
AFFECTS: users of ports-mgmt/portmaster
AUTHOR: bdrewery@FreeBSD.org

Portmaster now supports pkgng. To use pkgng, enable the patch in the port,
enable pkgng in your make.conf, and convert your existing /var/db/pkg
database. Also see UPDATING entry 20121010 if you are on a recent CURRENT
and do not want to use pkg.

This is optional and not currently required.

# make -C /usr/ports/ports-mgmt/pkg install clean
# make -C /usr/ports/ports-mgmt/portmaster config build deinstall install clean
# echo 'WITH_PKGNG=yes' >> /etc/make.conf
# pkg2ng
Then later, trying to troubleshoot by myself I also followed this instructions:
Ensure your pkg(8) is up-to-date. 'pkg -v' should say at least 1.1.4. If it does not, first upgrade from ports.
Remove any repository-specific configuration from /usr/local/etc/pkg.conf, such as PACKAGESITE, MIRROR_TYPE, PUBKEY. If this leaves your pkg.conf empty, just remove it.
mkdir -p /usr/local/etc/pkg/repos
Create the file /usr/local/etc/pkg/repos/FreeBSD.conf with:
Code:
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  enabled: yes
}
 
Let's see if there's anything installed, or perhaps pkg2ng failed for some packages (I've had that happen a couple of times). What do these commands output?

pkg_info -x perl
pkg info perl
 
Code:
[myso@pha ~]$ sudo pkg_info -x perl
pkg_info: the package info for package 'perl5-5.16.3_4' is corrupt
[myso@pha ~]$ sudo pkg info perl
pkg: No package(s) matching perl
But I'm sure it's there, because I have installed (reinstalled) it today, and not just once! :beergrin (using make install clean from the port directory).
Code:
[myso@pha ~]$ ls -la /var/db/pkg | grep perl
drwxr-xr-x    2 root  wheel         4 Dec  4 09:44 perl5-5.16.3_4
 
Look again at your /etc/make.conf. Comment out that .include, and make certain there are no extra spaces and that the underlines and dashes are correct.
 
Honestly, I have no idea where the include line comes from, It wasn't there a few days ago. Maybe when I tried reinstalling Portmaster.

It seems to me, that Portmaster still uses pkg instead of PKGNG, for example look at this:
Code:
[myso@pha /usr/ports/lang/perl5.16]$ sudo make install clean
===>  Installing for perl5-5.16.3_4
===>  Checking if lang/perl5.16 already installed
===>   Registering installation for perl5-5.16.3_4
pkg-static: (perl5-5.16.3_4) /usr/ports/lang/perl5.16/work/stage//usr/local/bin/perl - shared library libperl.so not found
pkg-static: (perl5-5.16.3_4) /usr/ports/lang/perl5.16/work/stage//usr/local/bin/perl5.16.3 - shared library libperl.so not found
Removing /usr/local/etc/perl5_version... Done.
Creating /usr/local/etc/perl5_version... Done.
Removing stale symlinks from /usr/bin...
    Skipping /usr/bin/perl
    Skipping /usr/bin/perl5
Done.
Creating various symlinks in /usr/bin...
    Symlinking /usr/local/bin/perl5.16.3 to /usr/bin/perl
    Symlinking /usr/local/bin/perl5.16.3 to /usr/bin/perl5
Done.
Should it still use pkg-static? Another thing which crossed my mind: I read somewhere that I should be able to tell Portmaster in the CONFIG options to use PKGNG. But I don't have the option there.

New information:
Code:
[myso@pha /usr/ports/lang/perl5.16]$ pkg_info -x perl
pkg_info: no packages match pattern(s)
[myso@pha /usr/ports/lang/perl5.16]$ pkg info perl
pkg: No package(s) matching perl
[myso@pha /usr/ports/lang/perl5.16]$ pkg info perl*
perl5-5.16.3_4
Code:
[myso@pha /usr/ports/lang/perl5.16]$ sudo portmaster -r perl

===>>> /var/db/pkg/perl does not exist
===>>> Aborting update

===>>> Killing background jobs
Terminated
===>>> Exiting
 
pkg is "pkgng". The first is the command, the second the name of the system.

The last output indicates that the old package tools are still being used.

Please show the current contents of /etc/make.conf. Also, try it without sudo. sudo usually works, but it is not the same as su - or just logging in as root.
 
Code:
[root@pha /]# cat /etc/make.conf
#.include "/usr/local/etc/ports_sites.conf"
#FORCE_PKG_REGISTER=YES
WITH_PKGNG=yes
 
Today I tried to run pkg2ng and afterwards portmaster -r perl from within the root shell, which ended successfully reinstalling three ports. Now I'm trying to update my ports tree.
 
Hi all, I am using the following:
Code:
root@server:~ # pkg info | grep perl
p5-DBI-1.630                   The perl5 Database Interface.  Required for DBD::* modules
p5-Error-0.17021               Perl module to provide Error/exception support for perl: Error
p5-perl-ldap-0.5700            Client interface to LDAP (includes Net::LDAP)
perl5.18-5.18.1_4              Practical Extraction and Report Language
root@server:~ # pkg info perl5.18-5.18.1_4
perl5.18-5.18.1_4
Name           : perl5.18
Version        : 5.18.1_4
......
WWW: http://www.perl.org/
root@server:~ #
For instructions about http://www.freebsd.org/doc/handbook/pkgng-intro.html
Code:
Important:
This step is not reversible. Once the package database has been converted to the pkgng format, the traditional pkg_* tools should not be used.
 
Ok folks, It seems that everything works fine now, today I accomplished upgrading the whole queue.

I don't really know what the problem was, perhaps using sudo instead of su? Never mind, thank you so much for supporting me in those hard times :beer
 
Back
Top