Discussion:
/usr/pkg/lib/libgobject-2.0.so.8: Shared object "libffi.so.8" not found
(too old to reply)
Bruce Nagel
2022-03-06 13:13:19 UTC
Permalink
I just made the error of trying to upgrade the gimp using pkgin again.
It seems like every time I use pkgin to upgrade my installed version of
either gimp or libreoffice a library issue like this pops up and breaks
something important.


I'm running NetBSD 9.0 on amd64.

When I attempt to run X I get an error:

/usr/pkg/lib/libgobject-2.0.so.0: shared object "libffi.so.8" not found
and X will not start.

mutt will not let me compose an email, vim fails to start. Fortunately
I was able to ssh into sdf.org to send this, as I have no idea what all
else won't run without libffi.

I have tried: pkgin install libffi

It indicates that it's installing libffi-3.4.2nb1 and gives no errors or
warnings.

After doing that I don't see a copy of libffi.so.8 in /usr/pkg/lib.


When I try: pkgin remove libffi

It indicates that there is "no such installed package libffi"


Any ideas on how I can resolve this?

Would it be a bad idea to try to compile and install libffi locally from
/usr/pkgsrc/devel?


It seems like pkgin itself is having issues, is there something I can do
to troubleshoot that?

Should I risk trying to upgrade pkgin (using pkgin or compiling in
/usr/pkgsrc)?


In the bigger picture, how do I avoid getting into this situation in the
future, just avoid pkgin? What are the good alternatives?


Thank you,
Bruce
--
Behold, we must sully the fresh snow with footprints in order to get anywhere.
(Ursula LeGuin)


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Greg Troxel
2022-03-06 13:44:18 UTC
Permalink
Post by Bruce Nagel
I'm running NetBSD 9.0 on amd64.
What its the path in /usr/pkg/etc/pkgin/repositories.conf
Post by Bruce Nagel
I have tried: pkgin install libffi
It indicates that it's installing libffi-3.4.2nb1 and gives no errors or
warnings.
After doing that I don't see a copy of libffi.so.8 in /usr/pkg/lib.
I am using binary packages I built myself, but my libffi has that

$ pkg_info -L libffi
Information for libffi-3.4.2nb2:

Files:
/usr/pkg/include/ffi.h
/usr/pkg/include/ffitarget.h
/usr/pkg/info/libffi.info
/usr/pkg/lib/libffi.la
/usr/pkg/lib/libffi.a
/usr/pkg/lib/libffi.so
/usr/pkg/lib/libffi.so.8
/usr/pkg/lib/libffi.so.8.1.0
/usr/pkg/lib/pkgconfig/libffi.pc
/usr/pkg/man/man3/ffi.3
/usr/pkg/man/man3/ffi_call.3
/usr/pkg/man/man3/ffi_prep_cif.3
/usr/pkg/man/man3/ffi_prep_cif_var.3

lrwxr-xr-x 1 root wheel 15 Jan 10 09:47 /usr/pkg/lib/libffi.so.8 -> libffi.so.8.1.0
-rwxr-xr-x 1 root wheel 26120 Jan 10 09:47 /usr/pkg/lib/libffi.so.8.1.0
Post by Bruce Nagel
When I try: pkgin remove libffi
It indicates that there is "no such installed package libffi"
Probably you have a mix of two PKG_DBDIR locations in /var/db/pkg and /usr/pkg/pkgdb.

I didn't change the location, but I wrote up instructions and a script
of how to deal with it.

http://pkgsrc.org/pkgdb-change/


I strongly recommend setting PKG_DBDIR in all 3 places, under manual, no
matter what else you do. First you need to figure out where your pkgdb
is, and if two how to merge it.
Post by Bruce Nagel
Any ideas on how I can resolve this?
Would it be a bad idea to try to compile and install libffi locally from
/usr/pkgsrc/devel?
no but I am guessing that is not your problem.
Post by Bruce Nagel
It seems like pkgin itself is having issues, is there something I can do
to troubleshoot that?
Should I risk trying to upgrade pkgin (using pkgin or compiling in
/usr/pkgsrc)?
In the bigger picture, how do I avoid getting into this situation in the
future, just avoid pkgin? What are the good alternatives?
The pkgdb change is a one-time issue.
Greg Troxel
2022-03-07 14:04:19 UTC
Permalink
Looking through the 'pkgdb-change' page, I'm missing 2 of the 3 files
PKG_DBDIR=/var/db/pkg
PKG_DBDIR=/usr/pkg/pkgdb
I have no /etc/pkg_install.conf file or /usr/pkg/etc/pkg_install.conf -
should I create them and just include PKG_DBDIR=/usr/pkg/pkgdb in them?
Or do I need to do something more (is there other content needed in
those files)?
I would say yes, and then all the tools should agree on the pkgdb.
pkg_admin check: pkg_admin can't open
/var/db/pkg/gdk-pixbuf2-2.40.0nb2/+CONTENTS: No such file or directory
Start looking at the pkgdb, both of them. Learn what normal packages
look like. If there is a dir with no control files, just remove it.
pkg_admin rebuild-tree: pkg_admin: Cannot read +CONTENTS of package
gdk-pixbuf2-2.40.0nb2
Same problem as above.
_NetBSD-pkgdb check found: FATAL: TWO copies of PKG_DBDIR found
So it's definitely the split-brain package databases problem.
/usr/sbin/pkg_add -V gives: 20191008
/usr/sbin/pkg/pkg_add -V gives: 20210308
Do I need to fix anything there?
probably not, except that updating the base system to 9.2 is probably a
good idea. But with the PKG_DBDIR lines it should be ok.


So you need to dig in and see what is in both databases, and probably
you can move the dirs from /var/db/pkg to /usr/pkg/pkgdb or the other
way around (either is ok, but you must have 1 and you must have all 3
configs pointing to the chosen one. I prefer /usr/pkg/pkgdb at this
point.) This is sort of a manual merge process.

Then the script should fix up the embeedded paths. Read and understand
the script - I tried to comment it well.
Bruce Nagel
2022-03-12 17:05:25 UTC
Permalink
Post by Greg Troxel
Looking through the 'pkgdb-change' page, I'm missing 2 of the 3 files
PKG_DBDIR=/var/db/pkg
PKG_DBDIR=/usr/pkg/pkgdb
I have no /etc/pkg_install.conf file or /usr/pkg/etc/pkg_install.conf -
should I create them and just include PKG_DBDIR=/usr/pkg/pkgdb in them?
Or do I need to do something more (is there other content needed in
those files)?
I would say yes, and then all the tools should agree on the pkgdb.
pkg_admin check: pkg_admin can't open
/var/db/pkg/gdk-pixbuf2-2.40.0nb2/+CONTENTS: No such file or directory
Start looking at the pkgdb, both of them. Learn what normal packages
look like. If there is a dir with no control files, just remove it.
pkg_admin rebuild-tree: pkg_admin: Cannot read +CONTENTS of package
gdk-pixbuf2-2.40.0nb2
Same problem as above.
_NetBSD-pkgdb check found: FATAL: TWO copies of PKG_DBDIR found
So it's definitely the split-brain package databases problem.
/usr/sbin/pkg_add -V gives: 20191008
/usr/sbin/pkg/pkg_add -V gives: 20210308
Do I need to fix anything there?
probably not, except that updating the base system to 9.2 is probably a
good idea. But with the PKG_DBDIR lines it should be ok.
So you need to dig in and see what is in both databases, and probably
you can move the dirs from /var/db/pkg to /usr/pkg/pkgdb or the other
way around (either is ok, but you must have 1 and you must have all 3
configs pointing to the chosen one. I prefer /usr/pkg/pkgdb at this
point.) This is sort of a manual merge process.
Then the script should fix up the embeedded paths. Read and understand
the script - I tried to comment it well.
I made sure all 3 places had the some /PKG_DBDIR=/usr/pkg/pkgdb in them.

I did the 'manual merge' from /var/db/pkg and /var/db/pkg.refcount to
/usr/pkg/pkgdb and /usr/pkg/pkgdb.refcount. I removed the older
versions of duplicates in /usr/pkg/pkgdb. I removed the old /var/db/pkg
and /var/db/pkg.refcount directories.

I ran the script with 'check' and it found no problems.

I ran the script with 'migrate' and it reported no problems after
running.

pkg_admin check complains about failing md5 checksums for a variety of
things including the libffi that's been an issue all through this.

pkg_admin rebuild-tree complains about not being able to read the
+CONTENTS of gdk-pixbuf2-2.40.0nb2

pkgin appears to update and appears to install e.g., vim but vim does
not get installed, isn't in /usr/pkg/bin, it still doesn't appear to
actually do anything.


What do I investigate or try next?

Thanks,
Bruce
--
+


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Greg Troxel
2022-03-06 13:47:06 UTC
Permalink
You may be having some other problem. You may be able to recover by
using pkg_add on the libffi package that you can download manaully.
But this feels like a messed-up database.

Also, always good to

pkg_admin check
pkg_admin rebuild-tree
Todd Gruhn
2022-03-06 12:47:07 UTC
Permalink
My fist Q is: What version/release of pkgsrc?

I recall having probs with libffi several mo ago....
Post by Greg Troxel
You may be having some other problem. You may be able to recover by
using pkg_add on the libffi package that you can download manaully.
But this feels like a messed-up database.
Also, always good to
pkg_admin check
pkg_admin rebuild-tree
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Greg Troxel
2022-03-12 18:45:38 UTC
Permalink
Post by Bruce Nagel
I made sure all 3 places had the some /PKG_DBDIR=/usr/pkg/pkgdb in them.
ok
Post by Bruce Nagel
I did the 'manual merge' from /var/db/pkg and /var/db/pkg.refcount to
/usr/pkg/pkgdb and /usr/pkg/pkgdb.refcount. I removed the older
versions of duplicates in /usr/pkg/pkgdb. I removed the old /var/db/pkg
and /var/db/pkg.refcount directories.
So now you have *no* /var/db/pkg*, and you do have /usr/pkg/pkgdb.
Post by Bruce Nagel
I ran the script with 'check' and it found no problems.
I ran the script with 'migrate' and it reported no problems after
running.
ok, that's good. That more or less means that you have recovered from
split-brain, but not that everything is ok.
Post by Bruce Nagel
pkg_admin check complains about failing md5 checksums for a variety of
things including the libffi that's been an issue all through this.
That means the installed package does not match the control files.
Either:

Get a binary for the package, and pkg_add -u -U libffi...

pkg_delete -f libffi # this will break things but they are broken already
pkgin in libffi
pkgin uk libffi # because it's a dependency, not something you personally want
Post by Bruce Nagel
pkg_admin rebuild-tree complains about not being able to read the
+CONTENTS of gdk-pixbuf2-2.40.0nb2
That package's control data is messed up. Same plan for update-anyway
or remove/reinstall.
Post by Bruce Nagel
pkgin appears to update and appears to install e.g., vim but vim does
not get installed, isn't in /usr/pkg/bin, it still doesn't appear to
actually do anything.
Go to /usr/pkg/pkgdb/vim* and read all the files. +CONTENTS probably
shows bin/vim, but I use emacs :-)

Run "pkg_check vim".

But, first resolve every problem shown by pkg_admin check and pkg_admin
rebuild-tree before trying to add things.

Loading...