I downgrade glibc, and I can not boot any more

I try to recover from the live usb use sudo pacman --root /mnt -Syu
but I get the following error

:: Synchronizing package databases...
 core is up to date
 extra is up to date
 multilib is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (3) glibc-2.39-1.1  glibc-locales-2.39-1.1  lib32-glibc-2.39-1.1

Total Installed Size:  283.55 MiB
Net Upgrade Size:       29.10 MiB

:: Proceed with installation? [Y/n] y
(3/3) checking keys in keyring                                                                                                                                                                [#######################################################################################################################] 100%
(3/3) checking package integrity                                                                                                                                                              [#######################################################################################################################] 100%
(3/3) loading package files                                                                                                                                                                   [#######################################################################################################################] 100%
(3/3) checking for file conflicts                                                                                                                                                             [#######################################################################################################################] 100%
(3/3) checking available disk space                                                                                                                                                           [#######################################################################################################################] 100%
:: Running pre-transaction hooks...
(1/1) Creating Timeshift snapshot before upgrade...
/bin/bash: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/bash)
/bin/bash: /usr/lib/libc.so.6: version `GLIBC_2.36' not found (required by /bin/bash)
/bin/bash: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /usr/lib/libreadline.so.8)
error: command failed to execute correctly
error: failed to commit transaction (failed to run transaction hooks)
Errors occurred, no packages were upgraded.

When I directly reboot, it’s the same error like

/bin/bash: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/bash)
/bin/bash: /usr/lib/libc.so.6: version `GLIBC_2.36' not found (required by /bin/bash)
/bin/bash: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /usr/lib/libreadline.so.8)

What can I try now?

Hi @lijunjie,

I think you need to boot into a live environment, enter a chroot environment from there, download the pacman-static package there, and re-sync your system with that.

How to chroot

  1. Ensure you’ve got a relatively new ISO or at least one with a still supported LTS kernel.

  2. Write/copy/dd the ISO to a USB thumb drive.

  3. When done, boot with the above mentioned USB thumb drive into the live environment.

  4. Once booted, open a terminal and enter the following command to enter the chroot encironment:

manjaro-chroot -a
  1. If you have more than one Linux installation, select the correct one to use from the list provided.

When done, you should now be in the chroot environment.

But, be careful, as you’re now in an actual root environment on your computer, so any changes you make will persist after a restart.

From within the chroot environment, go the root home directory:

cd /root/

Once there, download the chroot-static package as described on its AUR Page:

wget https://pkgbuild.com/~morganamilo/pacman-static/x86_64/bin/pacman-static

When done, make sure it’s executable:

chmod +x pacman-static

And now do a complete resync of your system, although possibly only glibc would be necessary, but rather safe than sorry is my opinion:

./pacman-static -Syu --overwrite='*'

Note: the --overwrite='*' has potential to be very destructive. Do not use it willy-nilly. And use is strictly at own risk.

Continue as normal with the sync. When done, exit the chroot environment:

exit

…and reboot to see if it worked.

Hope it helps!

from man pacman

-r, --root <path>

Specify an alternative installation root (default is `/`). 
This should not be used as a way to install software into `/usr/local` instead of `/usr`.
 **NOTE**: If database path or log file are not specified on either the command line or in 
[pacman.conf(5)](https://archlinux.org/pacman/pacman.conf.5.html), 
their default location will be inside this root path. 
**NOTE**: This option is not suitable for performing operations on a mounted guest system. 
See *--sysroot* instead.

Not sure if I understand you correctly,
but with the live usb
you boot,
then you manjaro-chroot
then you can work on your system

It is likely that you cannot do that anymore after what you did.
You’d likely need to get and install pacman-static
(in the chroot environment)
and use that to fix your system.

1 Like

You don’t chroot, you just mount root to /mnt. No idea what OP is doing.

Welcome to the forum! :wave:

You have a backup, right? :wink:

:warning: Downgrading packages is not supported for a reason–especially system critcal packages like glibc.

Obviously that was not the solution to whatever problem you had to begin with. If you don’t have a backup or are not able to recover from a chroot, then you may as well save everyone including yourself some time and reinstall. Learn your lesson and move on. Hey, we’ve all made mistakes.

> sudo ./pacman-static -Syu --overwrite='*'                                                                             

warning: config file /etc/pacman.conf, line 20: directive 'SyncFirst' in section 'options' not recognized.
:: Synchronizing package databases...
 core is up to date
 extra                                                              8.6 MiB  5.91 MiB/s 00:01 [#######################################################] 100%
 multilib is up to date
:: Starting full system upgrade...
:: Replace bashrc-manjaro with core/bash? [Y/n] y
:: Replace kcolorpicker with extra/kcolorpicker-qt5? [Y/n] y
:: Replace kimageannotator with extra/kimageannotator-qt5? [Y/n] y
warning: yay: local (12.3.0-1) is newer than extra (12.2.0-1)
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing pacman (6.0.2-18) breaks dependency 'pacman-contrib' required by bmenu
:: installing pacman (6.0.2-18) breaks dependency 'pacman-contrib' required by pacui

How can I handle this? when I run sudo ./pacman-static -Syu --overwrite='*'

It seems you have some pacnew files to manage. Once you’re finished updating, install manjaro-pacnew-checker then reboot.

It seems you missed reading the latest Announcements post. :wink:

It seems that I can not manjaro-chroot -a at first time.
It still have the same problem.

> manjaro-chroot -a                                                         

grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
==> Mounting (ManjaroLinux) [/dev/sda2]
 --> mount: [/mnt]
 --> mount: [/mnt/boot/efi]
/bin/bash: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/bash)
/bin/bash: /usr/lib/libc.so.6: version `GLIBC_2.36' not found (required by /bin/bash)
/bin/bash: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /usr/lib/libreadline.so.8)
 --> umount: [/mnt/boot/efi]
 --> umount: [/mnt]

@Yochanan @zbe

chroot doesn’t work because the shell (bash)
as well as almost every other program
relies on a version of glibc which you no longer have.

I myself would just replace the files by
extracting the glibc package from the pacman cache
and then simply copying at least everything in /usr to the defunct system
Using the file manager this takes a tenth of the time than writing this here does …

That will then enable you to chroot and properly repair the system.


Perhaps you can use pacman similar to what you started with:

mount the system to /mnt

find the glibc package in the pacman cache - which is then under /mnt/var/cache/pacman/pkg/glibc-2...

ls -al mnt//var/cache/pacman/pkg/glibc-2*.zst

You will be able to see what you did and when by looking at the pacman log
for instance:
tac /mnt/var/log/pacman.log | grep "glibc ("

This will list when and from which version to which version you downgraded or upgraded,
most recent event first.

with that information, try installing from the pacman cache:
sudo pacman -U --root /mnt /mnt/var/cache/pacman/pkg/glibc-2.3....zst

with the correct file name, of course.
(provided that you still have it in the cache - if not you have to get a hold of it directly from some mirror)

It should work, but I don’t know - and will not test :wink:

ps:
I do not know why the error messages mention GLIBC_2.38 on one line and GLIBC_2.36 on the next.
Don’t know what to make of that.

Perhaps bash falls back to a previous version. :man_shrugging: