# Big trouble since upgrading to PKGNG



## myso (Dec 4, 2013)

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: 
	
	



```
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:


```
[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


----------



## Rulus (Dec 4, 2013)

Did you do run `pkg2ng`? Also, did you add 
	
	



```
WITH_PKGNG="yes"
```
 to your make.conf? You seem to be using pkg instead of pkgng.

Also, maybe one of these links could be useful:
http://lists.freebsd.org/pipermail/freebsd-current/2012-October/037098.html (I remember having installed this patch)
http://lists.freebsd.org/pipermail/freebsd-ports/2011-July/069011.html
https://forums.freebsd.org/viewtopic.php?&t=28559


----------



## ShelLuser (Dec 4, 2013)

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?


----------



## myso (Dec 4, 2013)

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
> 
> 
> 
> ...




```
[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?




```
[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):

```
[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
> 
> ...


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:




```
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  enabled: yes
}
```


----------



## SirDice (Dec 4, 2013)

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`


----------



## myso (Dec 4, 2013)

```
[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).

```
[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
```


----------



## wblock@ (Dec 4, 2013)

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.


----------



## myso (Dec 5, 2013)

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:

```
[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:

```
[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
```


```
[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
```


----------



## wblock@ (Dec 5, 2013)

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.


----------



## myso (Dec 6, 2013)

```
[root@pha /]# cat /etc/make.conf
#.include "/usr/local/etc/ports_sites.conf"
#FORCE_PKG_REGISTER=YES
WITH_PKGNG=yes
```


----------



## myso (Dec 6, 2013)

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.


----------



## wmoreno3 (Dec 7, 2013)

Hi all, I am using the following:

```
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

```
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.
```


----------



## myso (Dec 10, 2013)

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


----------

