DevHeads.net

Downgrading glibc from Rawhide removed /bin/sh (!)

$ sudo dnf install glibc-headers.i686
Last metadata expiration check: 0:53:05 ago on Thu 07 Mar 2019 09:42:26 GMT.
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Installing:
glibc-headers i686 2.29-7.fc30 rawhide 475 k
Downgrading:
glibc i686 2.29-7.fc30 rawhide 3.7 M
glibc x86_64 2.29-7.fc30 rawhide 3.9 M
glibc-all-langpacks x86_64 2.29-7.fc30 rawhide 25 M
glibc-common x86_64 2.29-7.fc30 rawhide 822 k
glibc-devel i686 2.29-7.fc30 rawhide 1.0 M
glibc-devel x86_64 2.29-7.fc30 rawhide 1.0 M
glibc-headers x86_64 2.29-7.fc30 rawhide 474 k
glibc-langpack-en x86_64 2.29-7.fc30 rawhide 820 k
glibc-static x86_64 2.29-7.fc30 rawhide 1.9 M

Transaction Summary
================================================================================
Install 1 Package
Downgrade 9 Packages

Total download size: 39 M
Is this ok [y/N]: y
Downloading Packages:
(1/10): glibc-2.29-7.fc30.x86_64.rpm 661 kB/s | 3.9 MB 00:06
(2/10): glibc-2.29-7.fc30.i686.rpm 610 kB/s | 3.7 MB 00:06
(3/10): glibc-common-2.29-7.fc30.x86_64.rpm 737 kB/s | 822 kB 00:01
(4/10): glibc-devel-2.29-7.fc30.i686.rpm 675 kB/s | 1.0 MB 00:01
(5/10): glibc-devel-2.29-7.fc30.x86_64.rpm 926 kB/s | 1.0 MB 00:01
(6/10): glibc-headers-2.29-7.fc30.x86_64.rpm 609 kB/s | 474 kB 00:00
(7/10): glibc-langpack-en-2.29-7.fc30.x86_64.rp 968 kB/s | 820 kB 00:00
(8/10): glibc-headers-2.29-7.fc30.i686.rpm 934 kB/s | 475 kB 00:00
(9/10): glibc-static-2.29-7.fc30.x86_64.rpm 882 kB/s | 1.9 MB 00:02
(10/10): glibc-all-langpacks-2.29-7.fc30.x86_64 1.3 MB/s | 25 MB 00:18
Error in <unknown> scriptlet in rpm package glibc-common
error: failed to exec scriptlet interpreter /bin/sh: No such file or directory
warning: %triggerpostun(glibc-common-2.29-7.fc30.x86_64) scriptlet failed, exit status 127

Error in <unknown> scriptlet in rpm package glibc-common
error: failed to exec scriptlet interpreter /bin/sh: No such file or directory
warning: %triggerpostun(info-6.5-12.fc30.x86_64) scriptlet failed, exit status 127

Error in <unknown> scriptlet in rpm package glibc-common
Running scriptlet: glibc-common-2.29-7.fc30.x86_64 19/19
error: failed to exec scriptlet interpreter /bin/sh: No such file or directory
warning: %triggerin(glibc-common-2.29-7.fc30.x86_64) scriptlet failed, exit status 127

Error in <unknown> scriptlet in rpm package glibc-common
Verifying : glibc-2.29-7.fc30.i686 1/19
Verifying : glibc-2.29.9000-4.fc31.i686 2/19
Verifying : glibc-2.29-7.fc30.x86_64 3/19
Verifying : glibc-2.29.9000-4.fc31.x86_64 4/19
Verifying : glibc-all-langpacks-2.29-7.fc30.x86_64 5/19
Verifying : glibc-all-langpacks-2.29.9000-4.fc31.x86_64 6/19
Verifying : glibc-common-2.29-7.fc30.x86_64 7/19
Verifying : glibc-common-2.29.9000-4.fc31.x86_64 8/19
Verifying : glibc-devel-2.29-7.fc30.i686 9/19
Verifying : glibc-devel-2.29.9000-4.fc31.i686 10/19
Verifying : glibc-devel-2.29-7.fc30.x86_64 11/19
Verifying : glibc-devel-2.29.9000-4.fc31.x86_64 12/19
Verifying : glibc-headers-2.29-7.fc30.x86_64 13/19
Verifying : glibc-headers-2.29.9000-4.fc31.x86_64 14/19
Verifying : glibc-langpack-en-2.29-7.fc30.x86_64 15/19
Verifying : glibc-langpack-en-2.29.9000-4.fc31.x86_64 16/19
Verifying : glibc-static-2.29-7.fc30.x86_64 17/19
Verifying : glibc-static-2.29.9000-4.fc31.x86_64 18/19
Verifying : glibc-headers-2.29-7.fc30.i686 19/19

Downgraded:
glibc-2.29-7.fc30.i686 glibc-2.29-7.fc30.x86_64
glibc-all-langpacks-2.29-7.fc30.x86_64 glibc-common-2.29-7.fc30.x86_64
glibc-devel-2.29-7.fc30.i686 glibc-devel-2.29-7.fc30.x86_64
glibc-headers-2.29-7.fc30.x86_64 glibc-langpack-en-2.29-7.fc30.x86_64
glibc-static-2.29-7.fc30.x86_64

Installed:
glibc-headers-2.29-7.fc30.i686

Complete!

$ ll /bin/sh
-bash: /usr/bin/ls: No such file or directory
$ sudo dnf install /bin/sh
-bash: /usr/bin/sudo: No such file or directory

Rich.

Comments

Re: Downgrading glibc from Rawhide removed /bin/sh (!)

By Florian Weimer at 03/07/2019 - 06:13

* Richard W. M. Jones:

That looks like a bug in itself.

The last time I looked at something similar, I saw this: RPM would not
adjust a pre-existing symbolic link to a new target very late in the
transaction. Like deleting old files which are gone in an update or
downgrade, this does *not* happen when the unpacking of the replacement
package happens, but towards the conclusion of the transaction. In the
meantime, scriptlets run with the broken file system.

In your case, maybe one of the scriptlet errors prevented the final step
with the adjustment of the symbolic link by RPM.

(Just to be clear, the symbolic link is regularly packaged, it's not
something that we manage using scripts.)

Thanks,
Florian

Re: Downgrading glibc from Rawhide removed /bin/sh (!)

By Panu Matilainen at 03/07/2019 - 07:41

On 3/7/19 1:13 PM, Florian Weimer wrote:
IIRC the issue is that at when ldconfig runs from the package scripts,
on downgrade the newer file is still on disk and thus ldconfig leaves
the link the way it is, but at the end of transaction it'll be gone and
symlinks can be broken.

$ rpm -q --filetriggers glibc-common
transfiletriggerin scriptlet (using /bin/sh) -- /lib, /lib64, /usr/lib,
/usr/lib64
/sbin/ldconfig
transfiletriggerpostun scriptlet (using /bin/sh) -- /lib, /lib64,
/usr/lib, /usr/lib64
/sbin/ldconfig

The %transfiletriggerpostun would've probably fixed it if it used -p
<lua> instead of shell.

Re: Downgrading glibc from Rawhide removed /bin/sh (!)

By Richard W.M. Jones at 03/07/2019 - 06:39

On Thu, Mar 07, 2019 at 12:13:22PM +0100, Florian Weimer wrote:
I fixed this by typing ‘ldconfig’ (thankfully I had a root shell open
on the IPMI console ...)

Rich.

Re: Downgrading glibc from Rawhide removed /bin/sh (!)

By Richard W.M. Jones at 03/07/2019 - 05:45

Actually it's more subtle. It didn't remove the files, but it did
break something really fundamental, perhaps execv? Perhaps new
binaries cannot link with the slightly older glibc?

$ echo /usr/bin/ls
/usr/bin/ls
$ /usr/bin/ls
-bash: /usr/bin/ls: No such file or directory

Rich.

Re: Downgrading glibc from Rawhide removed /bin/sh (!)

By Hans de Goede at 03/07/2019 - 05:57

Hi,

On 07-03-19 11:45, Richard W.M. Jones wrote:
In my experience with breaking systems through glibc changes,
the "No such file or directory" error is not about ls, it
is about /lib64/ld-linux.so.2 missing.

On my system I have:

[hans@shalem ~]$ ls -l /lib/ld-linux.so.2
lrwxrwxrwx. 1 root root 10 14 dec 01:46 /lib/ld-linux.so.2 -> ld-2.28.so

I suspect the symlink somehow ended up broken or missing
due to the downgrade.

Regards,

Hans