6

I've just upgraded readline to a new major release:

$ grep readline.*7 /var/log/pacman.log 
[2016-11-15 21:53] [ALPM] upgraded readline (6.3.008-4 -> 7.0-1)

Since this GNUPG is broken:

$ gpg 
gpg: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

That also means I can't upgrade any packages. How do I safely fix my installation?

What I've tried so far to downgrade readline:

  • The package is not in /var/cache/pacman/pkg
  • Building from the previous PKGBUILD failed because it doesn't bootstrap itself - it relies on awk which is also missing libreadline.so.6.
0

6 Answers 6

4

This has been reported to Arch here.

The workaround is to run

mkinitcpio -P

after the upgrade has completed, but before rebooting.

If you've rebooted before re-running mkinitcpio, then you'll need to boot off e.g. a USB key and run the mkinitcpio from the chroot. The easiest is to use arch-chroot as in the Arch install instructions.

I haven't had a chance to test this method in this particular case, however have done so in the past.

4
  • Upvoted. The only correct answer.
    – jasonwryan
    Nov 17, 2016 at 3:06
  • @jasonwryan I am confused. The linked bug report is about issues with LVM. This answer will fix problems during the init process, but that is not what the OP is asking about. I don't see how rebuilding the RAM disk is going to allow gpg to find libreadline.so.6 if it has been upgraded to libreadline.so.7.
    – StrongBad
    Nov 17, 2016 at 17:58
  • @StrongBad read the mkinitcpio developer's (Dave Reisner) comment: this is an ordering issue: everything else (lvm, gpg etc) is just noise...
    – jasonwryan
    Nov 17, 2016 at 18:04
  • I can't reproduce any longer, of course, but marking as accepted since it's the "official" solution.
    – l0b0
    Nov 17, 2016 at 19:34
3

Fixed by manually verifying and installing an older version:

  1. Download the previous release from Arch Linux Archive
  2. Copy the package and signature file to another machine and verifying the signature there
  3. Unpack the package: sudo tar -xvpf readline-6.3.008-4-x86_64.pkg.tar.xz -C / --exclude .PKGINFO --exclude .INSTALL

Warning: Other packages may contain pre- or post-install scripts. This one did not, but consider yourself warned!

2
  • By downgrading, you potentially leave your system in an unsupported partially upgraded state. An alternative is to upgrade packages until pacman works.
    – StrongBad
    Nov 15, 2016 at 23:27
  • I did immediately upgrade afterwards, so it should now be in a stable state.
    – l0b0
    Nov 16, 2016 at 8:25
3

It seems libreadline.so.7 is backward compatible enough for most utilities to keep working after running:

sudo ln -s /usr/lib/libreadline.so.7 /usr/lib/libreadline.so.6

After that it warned me that /usr/bin/bash: Symbol rl_readline_state has different size in shared object, consider re-linking, but I was able to update pacman-key and upgrade libgcrypt so that new packages would validate, and then pacman -S bash to rebuild my shell using readline 7.0.

After you've put out pacman's Catch-22-style fires, simply clean up with:

sudo rm /usr/lib/libreadline.so.6
0

I solve this by editing /etc/pacman.conf and uncomenting or adding this line under [options]:

SigLevel = Never

Save and run pacman -Syyu, it updates the system and repairs it. Then comment that line again and update the database.

2
  • 1
    That is not secure.
    – l0b0
    Nov 17, 2016 at 8:04
  • Not that isn't, but it works when you're hurry up, like me that day.
    – Snow Dev
    Mar 11, 2017 at 22:08
0

I did what @chbrown suggests:

sudo ln -s /usr/lib/libreadline.so.7 /usr/lib/libreadline.so.6

(also had linking warning)

Then I had a new error regarding ca-certificates-utils so I had to follow this: https://bugs.archlinux.org/task/53217#comment155971

pacman -Sy --force  ca-certificates-utils

And then I could:

pacman -Syu

And all the upgrades went well and the libreadline/libreadline linking error was fixed.

-2

It sounds like you have gotten your system into a weird partially upgraded state, but partial upgrades are not supported. The solution is that:

A simple pacman -Syu to a properly synced mirror will fix the problem as long as pacman is not broken.

Your problem is that pacman seems to be broken. You may be lucky and can fix things by simply turning package signing off. If you are worried about security, you can manually download the packages you need on another machine, check their signatures, and then add them to the package cache on the broken machine.

If in fact pacman is broken, then you need to manually reinstall pacman. This basically requires you to download the pacman dependencies and manually extract them in the correct places. Which packages need to be reinstalled depends on the exact state of your system.

4
  • Turning off package signing is not a safe option, I'm afraid.
    – l0b0
    Nov 15, 2016 at 23:02
  • @l0b0 see edit. Arch did not have package signing for years, but if you are worried about security, you can manually download the packages on another machine and check the signatures.
    – StrongBad
    Nov 15, 2016 at 23:08
  • Further, pacman -Syu will not necessarily solve this (as of this comment). In some cases, it can be the source of such issues.
    – Jules
    Nov 15, 2016 at 23:08
  • @StrongBad Please see my answer.
    – l0b0
    Nov 15, 2016 at 23:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .