1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

pkg2ng help please

Discussion in 'Installation and Maintenance of Ports or Packages' started by kapetros, Oct 16, 2012.

  1. kapetros

    kapetros New Member

    Messages:
    6
    Thanks Received:
    0
    Hello, I'm on FreeBSD 9.0 Stable, and after todays ports update, I show the new pkg2ng thing.
    Is this only for Current? because it broke my pkgdb, after executing the portmaster instructions in ports Updating file.
     
  2. cpm

    cpm Well-Known Member

    Messages:
    1,379
    Thanks Received:
    513
    Please read carefully:
     
  3. wmoreno3

    wmoreno3 New Member

    Messages:
    63
    Thanks Received:
    3
    That is seems, to be use with stable version ?

    Code:
    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.
    
      # make -C /usr/ports/ports-mgmt/portmaster config build deinstall install clean
      # echo 'WITH_PKGNG=yes' >> /etc/make.conf
      # pkg2ng
    
    20121015:
      AFFECTS: users of ports-mgmt/portupgrade
      AUTHOR: bdrewery@FreeBSD.org
    
      Portupgrade now supports pkgng. To use pkgng, enable it in your make.conf,
      and convert your databases.
    
      # echo 'WITH_PKGNG=yes' >> /etc/make.conf
      # pkg2ng
      # pkgdb -fu
     
  4. kpa

    kpa Well-Known Member

    Messages:
    4,106
    Thanks Received:
    812
    To make the point more clear, the mentioned tools do support PKGNG but nothing forces you to use PKGNG at this point. It's only if you're on 10-CURRENT PKGNG is turned on by default.
     
  5. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,628
    Thanks Received:
    2,385
    It's not only for -CURRENT. It works just fine on my 9-STABLE. But you have to realise both portmaster(8) and portupgrade(1) use the 'old' style pkg_tools. It stores it's data differently and thus these tools can't handle it. Hence the recent patches to both of them.
     
  6. kapetros

    kapetros New Member

    Messages:
    6
    Thanks Received:
    0
    Well thanks for the answers, the thing is that when I run the pkg2ng, perl-5.16.0 didn't installed because it was installing files in the same place with p5-IO-Compress-2.055, so the conversion ended up in failure.

    While executing the steps below to recover my system, pkgdb complained that there wasn't any packages in the database.
    Code:
    # rm -/var/db/pkg/pkgdb.db
    # pkgdb -Ffuv
    

    For now luckily I had a backup of my system, so I restore it to the original state.
     
  7. wmoreno3

    wmoreno3 New Member

    Messages:
    63
    Thanks Received:
    3
    I was using portmanager before, I think that I must be reinstall all system in order to rebuilds the system with portmaster, portupgrade or pkgng.

    Code:
    server# make install clean
    /usr/ports/ports-mgmt/pkg/work/pkg-1.0.1/pkg-static/pkg-static: not found
    *** Error code 127
    
    Stop in /usr/ports/ports-mgmt/pkg.
    server#
     
  8. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,711
    Thanks Received:
    2,271
    No, but you should reinstall the port upgrade programs after rebuilding them with the patches so they will see the new package information. It's not just a rebuild, use make config in the port directory to turn on the pkgng patches.
     
    wmoreno3 thanks for this.
  9. mariourk

    mariourk New Member

    Messages:
    155
    Thanks Received:
    0
    I had the same problem. I followed the instructions to use pkgng and suddenly my pkgdb was gone, the system kept telling me no packages were installed. Luckily I was able to undo all this, by restoring /var/db/pkg.bak, comment WITH_PKGNG=yes in /etc/make.conf and recompile ports-mgmt/portmaster and ports-mgmt/portupgrade without PKGNG support.

    However, I do like to know what went wrong. Can someone explain this to me?
     
  10. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,628
    Thanks Received:
    2,385
    Nothing went wrong, it did exactly what it's supposed to do. PKGNG is a replacement for the pkg_tools. If you start using it the old tools won't work anymore. This is by design.
     
  11. mariourk

    mariourk New Member

    Messages:
    155
    Thanks Received:
    0
    So, commands like
    Code:
    pkg_version -v | grep '<'
    suddenly don't work anymore? What am I supposed to use instead? Probably kicking in an open door, but is there some documentation that sheds some light on this? :q
     
  12. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,628
    Thanks Received:
    2,385
    Correct.

    A similar command:
    # pkg version -v | grep '<'

    pkg(8) (For some reason the FreeBSD manual browser doesn't seem to have it, it should be on your system though)

    http://wiki.freebsd.org/pkgng
     
  13. mariourk

    mariourk New Member

    Messages:
    155
    Thanks Received:
    0
    Aha, now I know what I did wrong.

    Thanks for enlightening me :beer
     
  14. phoenix

    phoenix Moderator Staff Member Moderator

    Messages:
    3,450
    Thanks Received:
    769
    And, for every pkg_* command, there is an equivalent "pkg *" command. It's not quite exactly 1:1, but it's very close.

    For example:
    • pkg_add --> pkg add
    • pkg_version --> pkg version
    • pkg_info --> pkg info
    • pkg_delete --> pkg delete or pkg remove
    • pkg_audit --> pkg audit
    And so on.

    Once you install pkg(8) and convert the package database using pkg2ng(8), don't ever touch the pkg_* tools again. Only use the pkg equivalents.
     
  15. jb_fvwm2

    jb_fvwm2 Active Member

    Messages:
    1,630
    Thanks Received:
    162
    I'm wondering if anyone could code up a /ports-mgmt/legacy-pkg which would formulate a /var/db/pkg "v9" database on top of the pkg database after pkg is installed. (And maybe legacy command front-ends for the newer ones...)
    Sounds difficult, but I see no other reasons why not.
     
  16. wmoreno3

    wmoreno3 New Member

    Messages:
    63
    Thanks Received:
    3
    I am using the old system until pkg2ng is the default, in order to do not have any problem.

    Code:
    FreeBSD mydomain 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