I have an annoying issue.
For some reason, pkgin doesn't install everything. When trying to compile from /usr/pkgsrc, I get the following on all packages:

===> Trying to handle out-dated pkg_install...
===> Cleaning for pkg_install-20201206
===> Installing dependencies for pkg_install-20201206
=> Build dependency cwrappers>=20150314: NOT found
=> Verifying reinstall for ../../pkgtools/cwrappers
===> Trying to handle out-dated pkg_install...
===> Cleaning for pkg_install-20201206
ERROR: This package has set PKG_FAIL_REASON:
ERROR: Circular dependency detected

Checking to see which cwrappers is installed, I ran pkgin remove cwrappers:

1 packages to delete:
cwrappers-20180325

So make thinks pkg_install is out of date, except its 1 day old, and it also is looking for cwrappers greater than 2015, which is installed.

I have updated via CVS the /usr/pkgsrc, and pkgin upgrade does nothing at this point.

Any thoughts as to how I can solve this issue?

    0x1b Any thoughts as to how I can solve this issue?

    Follow the discussion in this mailing-list thread.

    0x1b
    This is due to the move of pkgdb.

    Disclaimer 1: I'm not sure things will change slightly going forward and what further adjustments will be implemented.

    Disclaimer 2: At some of the following stages the system will have no package manager, please make no mistakes. You will need to force remove pkgin and pkg_install. Warning: back-up your stuff in case you will need to re-install.

    Please make sure your pkgsrc tree is up-to-date where ever you have it, I'll assume the default location from now on.

    $ cs /usr/pkgsrc
    $ cvs up -dP
    # pkg_delete -ff pkgin pkg_install

    At this point you have no package manager and no way to go back, only forward ๐Ÿ˜‰

    $ cd pkgtools/pkg_install
    # mv /var/db/pkg /usr/pkg/pkgdb
    # mv /var/db/pkg.refcount /usr/pkg/pkgdb.refcount
    # make USE_CWRAPPERS=no install
    $ cd /usr/pkg/sbin
    # install -c pkg_add pkg_admin pkg_create pkg_delete pkg_info /usr/sbin/
    $ cd /usr/pkgsrc/pkgtools/pkg_install
    # make clean
    # make clean-depends
    # make distclean

    At this point you have only the pkg_install tools available to work with. Actually, you should have two copies of the tools. Check if you want, pkg_* should be present inside both, /usr/sbin and /usr/pkg/sbin. We need to get rid of the second set before we build pkgin

    Fix to pkgin issues: cd to / and edit root's .profile, moving /usr/pkg/sbin before /usr/sbin.

    $ cd /usr/pkgsrc/pkgtools/pkgin
    $ make
    # make install
    # make clean
    # make clean-depends
    # make distclean

    Yes, pkg_delete will remove only the copies inside /usr/pkg/sbin. Another way to do this would be to manually delete all the pkg_* components from inside the directory itself, both work.

    Final test, you might have noticed that while building pkgin, you had to actually build net/libfetch dependency first. This is a build dependency of pkgin but, its not a runtime dependency. If everything worked you should be able to remove it using the newly built pkgin. Let's try,

    # pkgin remove libfetch
    Password:
    1 packages to delete: 
      libfetch-2.39nb1
    
    proceed ? [Y/n] y

    Good to go then ๐Ÿ˜‰

    Now, upgrading using pkgin should be fine.

    Good prรฉcis; +1

    • pin replied to this.

      rvp Initially, I didn't want to post this, not to override the official instructions.
      But, after a few days, they are still missing the how to handle pkgin.

      So there you have it. This is the result of an off-list discussion and a couple of trial builds.

      • pfr likes this.

      So I've been trying all morning with the "official" and other suggestions.

      Here is my point I am stuck at:
      '
      make USE_CWRAPPERS=no install
      ===> Installing binary package of pkg_install-20201206
      pkg_add: A different version of pkg_install-20201206 is already installed: pkg_install-20200701 '

      Now, I DID run pkg_delete -ff, and it DID "removing anyway", but in one of the directories /usr/pkg/pkgdb/.... it still lists pkg_install, and in the other directory (whatever is at the end of the mv string in the instructions) it is not listed.

      And you are correct, now I have no pkgin, and no pkg_install that works.

      I even tried 'make replace' but that exits with "can't find something I need that's aperenlty very important"

      I thought about manually removing the existing directory entry, but at this point I'm almost ready to give up, and reinstall the base system. It's just my laptop, so no major loss. I'm also having some major issues with firefox/nightly crashing and taking xfce with it.... so...

      Unless there is a fix, perhaps its for the best? Thanks for your assistance! This forum is awesome!

      • pin replied to this.

        0x1b The instructions above are exactly how I did it and it works. You need to remove pkg_install and pkgin before you move the pkgdb, otherwise they will still be listed.

        You can move things back to /usr/sbin and follow the steps above in order.

        You could also try using make USE_CWRAPPERS=no update instead of install, just make sure you uninstall pkgin first.

          pin
          Installing binary package of pkg_install-20201206
          pkg_add: /usr/pkg/pkgdb/pkg/+CONTENTS: No such file or directory

          This is the problem when running anything other than make install. make update / replace both fail with this same error.

          • pin replied to this.

            0x1b What's the output of the following commands
            $ ls -l /var/db
            and
            $ find /usr/sbin -name pkg_*
            and
            $ find /usr/pkg/sbin -name pkg_*
            and
            $ ls -l /usr/pkg

            ls -l /var/db
            total 57800
            drwx------   2 bitlbee nobody       512 Dec  7 14:38 bitlbee
            drwxr-xr-x   2 dbus    dbus         512 Dec  6 02:11 dbus
            drwxr-xr-x   2 root    wheel        512 Dec  7 13:50 dhcpcd
            -rw-------   1 root    wheel        536 Dec  8 06:35 entropy-file
            -r--r--r--   1 root    wheel     392535 Oct 18 15:24 libc.tags
            -rw-r--r--   1 root    wheel          0 Oct 18 15:24 locate.database
            -rw-r--r--   1 root    wheel   58359808 Dec  8 06:35 man.db
            drwxr-xr-x   2 root    wheel        512 Oct 18 15:24 ns
            drwxr-xr-x   2 root    wheel        512 Dec  5 16:04 obsolete
            drwxr-xr-x 457 root    wheel      13312 Dec  8 09:22 pkg
            drwxr-xr-x   3 root    wheel        512 Dec  8 03:42 pkgin
            drwxr-xr-x   2 postfix postfix      512 Dec  5 17:25 postfix
            drwxr-xr-x   3 root    wheel        512 Dec  6 02:28 samba4
            -rw-r--r--   1 root    wheel     339325 Dec  5 17:25 services.cdb
            drwxr-xr-x   3 root    wheel        512 Dec  5 17:25 xdm
            drwxr-xr-x   2 root    wheel        512 Dec  8 06:35 xkb
            find /usr/sbin -name pkg_*
            zsh: no matches found: pkg_
            find /usr/pkg/sbin -name pkg_*
            zsh: no matches found: pkg_*
            ls -l /usr/pkg
            total 204
            drwxr-xr-x   2 root wheel 34304 Dec  8 09:22 bin
            drwxr-xr-x   2 root wheel   512 Dec  6 02:28 bind-dns
            drwxr-xr-x  30 root wheel  1024 Dec  8 03:42 etc
            drwxr-xr-x   9 root wheel   512 Dec  6 04:25 gcc7
            drwxr-xr-x   4 root wheel   512 Dec  6 02:17 gnu
            drwxr-xr-x 225 root wheel 10240 Dec  8 03:42 include
            drwxr-xr-x   2 root wheel  2048 Dec  6 07:51 info
            drwxr-xr-x   3 root wheel   512 Dec  6 04:24 java
            drwxr-xr-x  80 root wheel 74240 Dec  8 03:42 lib
            drwxr-xr-x   4 root wheel   512 Dec  6 02:12 libdata
            drwxr-xr-x  21 root wheel  2048 Dec  8 03:32 libexec
            drwxr-xr-x   5 root wheel   512 Dec  6 04:24 libreoffice-7.0.1.2
            drwxr-xr-x  26 root wheel   512 Dec  6 02:42 man
            drwxr-xr-x   3 root wheel   512 Dec  6 02:29 modules
            drwxr-xr-x 458 root wheel 13312 Dec  8 09:51 pkgdb
            drwxr-xr-x   6 root wheel   512 Dec  6 02:12 pkgdb.refcount
            drwxr-xr-x  11 root wheel   512 Dec  6 03:14 qt5
            drwxr-xr-x   2 root wheel  1536 Dec  8 04:32 sbin
            drwxr-xr-x 123 root wheel  2560 Dec  8 03:42 share
            drwxr-xr-x   4 root wheel   512 Dec  8 03:42 var
            • pin replied to this.

              0x1b I hope you don't mind but, I've formated your post to make it easier to read.

              Could I also have the output of ls -lp /usr/pkg/pkgdb | grep pkgin and ls -lp /var/db/pkg ?
              If the second command outputs something containing pkgdb, please provide also the output of ls -lp /var/db/pkg/pkgdb | grep pkgin.

              Thanks!

              • Jay likes this.

              I'm still learning this website, I'll do better next time.
              Here are the outputs:

              'ls -lp /usr/plg/pkgdb | grep pkgin
              gls: cannot access '/usr/plg/pkgdb': No such file or directory
              ls -lp /var/db/pkg | grep pkg
              drwxr-xr-x 463 root wheel    13312 Dec  8 04:45 pkg/
              drwxr-xr-x   2 root wheel      512 Dec  8 04:45 pkgconf-1.6.0/
              -rw-r--r--   1 root wheel 23699456 Dec  8 09:22 pkgdb.byfile.db
              gls: cannot access '/var/db/pkg/pkgdb': No such file or directory
              • pin replied to this.

                0x1b ls -lp /usr/plg/pkgdb | grep pkgin

                pkg, not plg ๐Ÿ˜‰

                ls -lp /usr/pkg/pkgdb | grep pkgin
                drwxr-xr-x   2 root wheel      512 Dec  8 03:28 pkgin-20.8.0/
                10 GET COFFEE
                20 DRINK COFFEE
                30 GOTO 10
                ````
                • pin replied to this.

                  0x1b

                  ls -l /var/db
                  total 57800
                  ...
                  drwxr-xr-x 457 root    wheel      13312 Dec  8 09:22 pkg
                  ...

                  So, something was left behind after all.

                  find /usr/sbin -name pkg_*
                  zsh: no matches found: pkg_
                  find /usr/pkg/sbin -name pkg_*
                  zsh: no matches found: pkg_*

                  Yes, pkg_install is not there anymore.

                  ls -l /usr/pkg
                  total 204
                  ...
                  drwxr-xr-x 458 root wheel 13312 Dec  8 09:51 pkgdb
                  drwxr-xr-x   6 root wheel   512 Dec  6 02:12 pkgdb.refcount
                  ...

                  Good, these are in place now

                  ls -lp /usr/pkg/pkgdb | grep pkgin
                  drwxr-xr-x   2 root wheel      512 Dec  8 03:28 pkgin-20.8.0/

                  We need to address this and re-build pkgin. Later...

                  ls -lp /var/db/pkg | grep pkg
                  drwxr-xr-x 463 root wheel    13312 Dec  8 04:45 pkg/
                  drwxr-xr-x   2 root wheel      512 Dec  8 04:45 pkgconf-1.6.0/
                  -rw-r--r--   1 root wheel 23699456 Dec  8 09:22 pkgdb.byfile.db

                  Hmm... so, these are the leftovers.

                  WARNING: I don't promisse this will work it would have been better to do it as described above. But, if you want to try... hope I got it all right

                  # mv /var/db/pkg /usr/pkg/pkgdb
                  # mv /var/db/pkgconf-1.6.0 /usr/pkg/pkgdb
                  # mv /var/db/pkg/pkgdb.byfile.db /usr/pkg/pkgdb
                  $ cd /usr/pkgsrc/
                  $ cvs up -dP
                  $ cd pkgtools/pkg_install
                  # make USE_CWRAPPERS=no install
                  $ cd /usr/pkg/sbin
                  # install -c pkg_add pkg_admin pkg_create pkg_delete pkg_info /usr/sbin/
                  $ cd /usr/pkgsrc/pkgtools/pkg_install
                  # make clean
                  # make clean-depends
                  # make distclean

                  EDIT: cd to / and edit root's .profile, moving /usr/pkg/sbin before /usr/sbin.

                  $ cd /usr/pkgsrc/pkgtools/pkgin
                  $ make
                  # make install
                  # make clean
                  # make clean-depends
                  # make distclean

                  Good luck!

                  EDIT: If, removing pkgin fails we'll have to do it manually. Let me know how it goes.

                  • Jay likes this.

                  Warning: Something is still badly broken in connection to the pkgdb move and pkgin

                    pin Phewwwww... then I can stop getting more and more C0FFEE while retrying... I solved my local hiccups on amd64 and i386 VMs with a symlink (/var/db/pkg โ€“> /usr/pkg/pkgdb) and will delay updates of other systems until more info materialises.

                    ...staying เฅmmmmmmptimistic...

                    
                    make USE_CWRAPPERS=no install
                    ===> Installing binary package of pkg_install-20201206
                    pkg_add: /usr/pkg/pkgdb/pkg/+CONTENTS: No such file or directory
                    *** Error code 1

                    Still can't build this package after cvs update.

                    SOOOOO, when I get back home tomorrow, I may just reinstall.

                    • pin replied to this.

                      0x1b when I get back home tomorrow, I may just reinstall.

                      To be honest, I'm considering doing the same right now.

                      • Jay likes this.

                      Found the issue with the instructions. Both the official and mine. Updating the original post above now.