Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] How to emergency manual install of libffi-compat.

104 views
Skip to first unread message

Alan Grimes

unread,
Aug 20, 2021, 3:00:05 AM8/20/21
to
Apparently installing libffi-compat will un-hose my system where ALL
SOFTWARE that needs FFI thru python is broken, especially all portage
tooling...

Is there a repository and walkthru for installing this?

Am I really the world's unluckiest gentoo user or was the pooch really
screwed on this issue?

https://packages.gentoo.org/packages/dev-libs/libffi-compat

--
Beware of Zombies. =O
#EggCrisis #BlackWinter
White is the new Kulak.
Powers are not rights.

Michael

unread,
Aug 20, 2021, 5:10:05 AM8/20/21
to
On Friday, 20 August 2021 07:55:34 BST Alan Grimes wrote:
> Apparently installing libffi-compat will un-hose my system where ALL
> SOFTWARE that needs FFI thru python is broken, especially all portage
> tooling...
>
> Is there a repository and walkthru for installing this?

This may help:

https://wiki.gentoo.org/wiki/Project:Portage/Fixing_broken_portage

If that won't work for whatever reason, chroot into your system after you boot
with the latest Live-USB and try to update @system. Alternatively, reinstall.
signature.asc

Neil Bothwick

unread,
Aug 20, 2021, 9:20:04 AM8/20/21
to
Boot into the live USB, if it has libffi-compat installed, you can
quickpkg it. Then you can untar the package into / before emerging it
properly.

In future, you should add buildpkg to FEATURES so that you always have
binary packages of software so you can roll back with tar in an emergency.


--
Neil Bothwick

We've all heard that a million monkeys banging on a million
typewriters will eventually reproduce the works of Shakespeare.
Now, thanks to the Internet, we know this is not true.

Andrea Conti

unread,
Aug 20, 2021, 12:20:03 PM8/20/21
to

I've bitten by this too... the problem is that portage does not follow a particular order when rebuilding subslot deps, so when upgrading dev-libs/libffi (in this case from 0/7 to 0/8) it can schedule lots of other packages between when the new libffi is installed and when python is rebuilt. If portage is interrupted for any reason during this period, you're screwed.

To recover, I followed these steps:

1. temporarily bring back /usr/lib/libffi.so.7 (/usr/lib64/libffi.so.7 if you're on amd64) from whatever source you can find (backup, saved binpkg, livecd/usb). You will need to copy both the actual library (libffi.so.7.x.y) and the versioned symlink (libffi.so.7 -> libffi.so.7.x.y); make sure you do not touch the existing libffi.so -> libffi.so.8.z.w symlink
2. re-emerge your main python version (the one you use to run portage, see emerge --info)
3. finish your upgrade
4. remove the files you copied in 1
5. do a revdep-rebuild pass, just in case

I would not call installing dev-libs/libffi-compat a solution -- you still need a working python to do that, and it won't protect you from future breakage like this.

It will not help in this case, since what's broken is python and not portage.

If that won't work for whatever reason, chroot into your system after you boot 
with the latest Live-USB and try to update @system.  Alternatively, reinstall.

Neither will this, as you won't be able to execute python (i.e. run portage) inside the chroot.

HTH

andrea


Michael

unread,
Aug 21, 2021, 9:10:04 AM8/21/21
to
On Friday, 20 August 2021 17:11:59 BST Andrea Conti wrote:

> >> This may help:
> >>
> >> https://wiki.gentoo.org/wiki/Project:Portage/Fixing_broken_portage
>
> It will not help in this case, since what's broken is python and not
> portage.
> > If that won't work for whatever reason, chroot into your system after you
> > boot with the latest Live-USB and try to update @system. Alternatively,
> > reinstall.
> Neither will this, as you won't be able to execute python (i.e. run portage)
> inside the chroot.

Right, my bad. I meant to write what Neil suggested - copy over binaries to
get whatever parts of your toolchain are broken working again - but didn't
obviously didn't write so. :-)

I can't recall coming come across this problem myself, probably because I tend
to leave emerge updates to finish, or resume from where I had stopped an
update. Is this a an error portage should be able to deal with itself when an
update is interrupted, then restarted?
signature.asc

Mart Raudsepp

unread,
Aug 22, 2021, 7:00:05 AM8/22/21
to
Ühel kenal päeval, L, 21.08.2021 kell 14:01, kirjutas Michael:
> I can't recall coming come across this problem myself, probably
> because I tend to leave emerge updates to finish, or resume from
> where I had stopped an update.  Is this a an error portage should be
> able to deal with itself when an update is interrupted, then
> restarted?

FEATURES="preserve-libs" (default enabled) should have preserved
/usr/lib/libffi.so.7 and it should have been fine enough. Not sure what
happened for him, maybe it has been disabled?


Mart
0 new messages