public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alexander Puchmayr <alexander.puchmayr@linznet.at>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Emerge -u -k package install order - broken system [SOLVED]
Date: Tue, 07 Sep 2021 09:31:36 +0200	[thread overview]
Message-ID: <2037573.PIDvDuAF1L@zeus> (raw)
In-Reply-To: <12960787.dW097sEU6C@zeus>

Am Montag, 6. September 2021, 16:33:32 CEST schrieb Alexander Puchmayr:
> Hi there,
> 
> I just tried to upgrade a older installation via binary packages and this
> broke my system. After around 25 packages of almost 300 it stopped with
> error and failing packages.
> 
> $ emerge
> Failed to validate a sane '/dev'.
> bash process substitution doesn't work; this may be an indication of a
> broken '/dev/fd'.
> $ ls -l /dev/fd/
> insgesamt 0
> lrwx------ 1 root root 64  6. Sep 14:18 0 -> /dev/pts/0
> lrwx------ 1 root root 64  6. Sep 14:18 1 -> /dev/pts/0
> lrwx------ 1 root root 64  6. Sep 14:18 2 -> /dev/pts/0
> lr-x------ 1 root root 64  6. Sep 14:18 3 -> /proc/27261/fd
> 
> --> looks allright, but:
> 
> $ bash
> bash: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /lib64/
> libreadline.so.8)
> 
> --> system broken(!), cannot start any shell anymore, cannot install
> anything anymore and it's obvious that the system is bricked after reboot
> or even when the ssh session I'm logged in is closed.
> 
> It seems like as if sys-libs/readline-8.1_p1-r1-1:0/8::gentoo is installed
> *before* installing a suitable glibc, breaking any binary that has the
> useflag readline (including bash).
> 
> Two questions:
> How do I get out of this mess?
> Why does portage not work in correct package order? Portage bug?

The problem was caused by a newly compiled sys-libs/readline as binary 
package. The package itself was compiled on my buildhost by a emerge -auvDN 
world, and when readline was compiled, the latest glibc-2.33 was already 
installed on the buildhost, hence the readline packet had a (implicit) 
dependency to >=glibc-33. Portage does not seem to be aware of that (the glibc 
version is not a dependency of readline), so portage did not care and install 
it at some suitable position later. From the time on that readline was emerged 
from that binary package, all programs linked with it have now that implicit 
dependency of >=glibc-2.33, which is not yet installed (which was 2.28). Bang!

HOW TO FIX THIS BREAKAGE:

For the system recovery I was lucky to have a backup of the old packages, so I 
could extract the readline-tbz2-package file to the temporary directly and copy 
the so files to /usr/local/lib64 (I chose /usr/local/ to avoid overwriting the 
package files) 

Ls -l /usr/local/lib64/
insgesamt 368
lrwxrwxrwx 1 root root     15  6. Sep 14:53 libhistory.so -> libhistory.so.8
lrwxrwxrwx 1 root root     17  6. Sep 15:04 libhistory.so.8 -> libhistory.so.
8.0
-rwxr-xr-x 1 root root  47368  6. Sep 14:53 libhistory.so.8.0
lrwxrwxrwx 1 root root     16  6. Sep 14:53 libreadline.so -> libreadline.so.8
lrwxrwxrwx 1 root root     18  6. Sep 15:04 libreadline.so.8 -> 
libreadline.so.8.0
-rwxr-xr-x 1 root root 325464  6. Sep 14:53 libreadline.so.8.0

Then, I created a ld.so.conf config file to ensure that /usr/local/lib is at 
*first* place:

echo "/usr/local/lib64" >/etc/ld.so.conf.d/10-temporary-fix.conf 
ldconfig

Notes: 
* The config file *must* end with .conf
* Although /usr/local/lib64 is already in the ld.so.conf file, this step is 
necessary to get it at first place; otherwise it is after /lib64 and /usr/
lib64, and ld.so finds the non-working version first
* setting LD_LIBRARY_PATH does not work as ebuild does not forward the 
environment variables from the calling process.

Test it with ldd /usr/bin/bash -- no errors shall be reported, and the 
readline library shall show the /usr/local/lib64 path.

Now, I could emerge glibc-2.33 the usual way (emerge -avk1 glibc), and then 
afterwards remove the temporary ld.so.conf file

rm /etc/ld.so.conf.d/10-temporary-fix.conf 
ldconfig

Test again with  ldd /usr/bin/bash -- the new readline library from /usr/lib64 
and /lib64 shall now be used. 
Now, the libraries from /usr/local/lib can be removed safely.

System recovered!

Best regards,
 Alex





      parent reply	other threads:[~2021-09-07  7:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 14:33 [gentoo-user] Emerge -u -k package install order - broken system Alexander Puchmayr
2021-09-06 17:38 ` Jack
2021-09-07  7:03   ` Alexander Puchmayr
2021-09-07  7:31 ` Alexander Puchmayr [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2037573.PIDvDuAF1L@zeus \
    --to=alexander.puchmayr@linznet.at \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox