wsldl-pg / ArchW-docs

ArchWSL documentation project
https://git.io/arch-doc
Creative Commons Attribution 4.0 International
54 stars 22 forks source link

Solve `GLIBC_2.34 not found` #35

Closed salvomcl closed 1 year ago

salvomcl commented 2 years ago

Hi, this PR solves the issue https://github.com/yuk7/ArchWSL/issues/280

As stated here https://bbs.archlinux.org/viewtopic.php?id=274705, executing sudo pacman -Syy ... before upgrading the whole system could lead to partial upgrades.

Thanks

rffontenelle commented 2 years ago

Installing archlinux-keyring is not considered a partial upgrade, and these steps are documented in ArchWiki: https://wiki.archlinux.org/title/Pacman/Package_signing#Upgrade_system_regularly. See:

Upgrade system regularly

Upgrading the system regularly via pacman#Upgrading packages prevents most signing errors. If delay is unavoidable and system upgrade gets delayed for an extended period, manually sync the package database and upgrade the archlinux-keyring package before system upgrade:

# pacman -Sy archlinux-keyring && pacman -Su

This command is not considered a partial upgrade since it syncs the package database and upgrades the keyring package first. Both must be processed just before starting system upgrade to ensure signatures of all upgraded packages can be properly verified.

salvomcl commented 2 years ago

thank you @rffontenelle. Doesn't worth to add the sudo pacman -Syu command in the installation guide? Otherwise, if a user installs directly a package eg. curl without upgrading the system has that issue related to GLIBC_2.34

rffontenelle commented 2 years ago

First, I am unable to reproduce this error. I just reinstalled my ArchWSL instance in WSL2 and followed every step in the How to Setup guide, and I was able to install archlinux-keyring without issue. I ran wsl.exe --unregister Arch and remove completely the folder where Arch.exe is in order to make sure I'd be register from scratch using the instructions in the setup guide.

Can you please try redoing it as well to confirm the issue that was presented to you?

Second, I have no doubt that running system upgrade (sudo pacman -Syu) is important, but not before installing the keyring. Installing the keyring before running system upgrade is exactly the point of the How to Setup's "Initialize keyring" section: without Arch's keyring properly set, some packages may fail to install if the developer/TU's keyring is not known to pacman. For example, see the first two messages in https://bbs.archlinux.org/viewtopic.php?id=191279

salvomcl commented 2 years ago

I am still able to reproduce the error. I installed arch following the method 1 and after I setup the default user, I run the following commands

>Arch.exe
[user@PC-NAME]$ sudo pacman-key --init

[user@PC-NAME]$ sudo pacman-key --populate

[user@PC-NAME]$ sudo pacman -Syy archlinux-keyring

[user@PC-NAME]$ sudo pacman -S curl

[user@PC-NAME]$ curl # which raises the error

Did you run these commands as well?

hexhexD commented 1 year ago

Had the same issue and pacman -Sy archlinux-keyring && pacman -Su after populate made all the difference for me.

hexhexD commented 1 year ago

@yuk7 @salvomcl I forgot to mention that you would run into keys not recognized or expired issue if you do pacman -Syu before pacman -Sy archlinux-keyring. So either swap the location of the two newly added lines or paste in the one line I mentioned above.