You are not logged in.

#1 2020-12-12 10:33:41

tigerjack
Member
Registered: 2017-08-20
Posts: 53

[SOLVED] - Curl (and pacman) broken after latest upgrade

Today I launched a full system upgrade, which installed the latest curl (7.74). From then, every time I try to use pacman, I get

pacman: error while loading shared libraries: /usr/lib/libcurl.so.4: file too short

Indeed, this is the state of those files

>ls -Al /usr/lib/libcurl.so*
lrwxrwxrwx 1 root root 16 Dec  9 10:19 /usr/lib/libcurl.so -> libcurl.so.4.7.0
lrwxrwxrwx 1 root root 16 Dec  9 10:19 /usr/lib/libcurl.so.4 -> libcurl.so.4.7.0
-rwxr-xr-x 1 root root  0 Dec  9 10:19 /usr/lib/libcurl.so.4.7.0

The /usr/lib/libcurl.so.4.7.0 is empty!

The log file from pacman does not show anything relevant

[2020-12-12T10:06:55+0100] [PACMAN] Running 'pacman -Syu'
[2020-12-12T10:06:55+0100] [PACMAN] synchronizing package lists
[2020-12-12T10:07:03+0100] [PACMAN] starting full system upgrade
[2020-12-12T10:07:14+0100] [ALPM] transaction started
[2020-12-12T10:07:14+0100] [ALPM] upgraded archlinux-keyring (20201028-1 -> 20201210-1)
[2020-12-12T10:07:14+0100] [ALPM-SCRIPTLET] ==> Appending keys from archlinux.gpg...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET] ==> Locally signing trusted keys in keyring...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Locally signing key AB19265E5D7D20687D303246BA1DFB64FFF979E7...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Locally signing key DDB867B92AA789C165EEFA799B729B06A680C281...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Locally signing key 0E8B644079F599DFC1DDC3973348882F6AC6A4C2...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Locally signing key D8AFDDA07A5B6EDFA7D8CCDAD6D055F927843F1C...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Locally signing key 91FFE0700E80619CEB73235CA88E23E377514E00...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET] ==> Importing owner trust values...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET] ==> Disabling revoked keys in keyring...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 4A8B17E20B88ACA61860009B5CED81B7C2E5C0D2...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 684148BB25B49E986A4944C55184252D824B18E8...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 5357F3B111688D88C1D88119FCF2CB179205AC90...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 50F33E2E5B0C3D900424ABE89BDCF497A4BBCC7F...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 39F880E50E49A4D11341E8F939E4F17F295AFBF4...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key F5A361A3A13554B85E57DDDAAF7EF7873CFD4BB6...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 40440DC037C05620984379A6761FAD69BA06C6A9...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key FB871F0131FEA4FB5A9192B4C8880A6406361833...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 487EACC08557AD082088DABA1EB2638FF56C0C53...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 76B4192E902C0A52642C63C273B8ED52F1D357C1...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 40776A5221EF5AD468A4906D42A1DB15EC133BAD...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 0B20CA1931F5DA3A70D0F8D2EA6836E1AB441196...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 07DFD3A0BC213FA12EDC217559B3122E2FA915EC...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 34C5D94FE7E7913E86DC427E7FB1A3800C84C0A5...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key B1F2C889CB2CCB2ADA36D963097D629E437520BD...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key D4DE5ABDE2A7287644EAC7E36D1A9E70E19DAA50...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 44D4A033AC140143927397D47EFD567D4C7EA887...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 8F76BEEA0289F9E1D3E229C05F946DED983D4366...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 27FFC4769E19F096D41D9265A04F9397CDFD6BB0...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 4FCF887689C41B09506BE8D5F3E1D5C5D30DB0AD...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 5A2257D19FF7E1E0E415968CE62F853100F0D0F0...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 7FA647CD89891DEDC060287BB9113D1ED21E1A55...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 5E7585ADFF106BFFBBA319DC654B877A0864983E...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key E7210A59715F6940CF9A4E36A001876699AD6E84...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 5559BC1A32B8F76B3FCCD9555FA5E5544F010D48...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 4D913AECD81726D9A6C74F0ADA6426DD215B37AD...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 8840BD07FC24CB7CE394A07CCF7037A4F27FB7DA...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key BC1FBE4D2826A0B51E47ED62E2539214C6C11350...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 9515D8A8EAB88E49BB65EDBCE6B456CAF15447D5...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key 779CD2942629B7FA04AB8F172E89012331361F01...
[2020-12-12T10:07:15+0100] [ALPM-SCRIPTLET]   -> Disabling key D921CABED130A5690EF1896E81AF739EC0711BF1...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET]   -> Disabling key 5696C003B0854206450C8E5BE613C09CB4440678...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET]   -> Disabling key 8CF934E339CAD8ABF342E822E711306E3C4F88BC...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET]   -> Disabling key 1A60DC44245D06FEF90623D6EEEEE2EEEE2EEEEE...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET]   -> Disabling key 81D7F8241DB38BC759C80FCE3A726C6170E80477...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET]   -> Disabling key 63F395DE2D6398BBE458F281F2DBB4931985A992...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET]   -> Disabling key 65EEFE022108E2B708CBFCF7F9E712E59AF5F22A...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET]   -> Disabling key 66BD74A036D522F51DD70A3C7F2A16726521E06D...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET] ==> Updating trust database...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET] gpg: next trustdb check due at 2021-08-02
[2020-12-12T10:07:16+0100] [ALPM] upgraded lz4 (1:1.9.2-2 -> 1:1.9.3-1)
[2020-12-12T10:07:16+0100] [ALPM] upgraded curl (7.73.0-1 -> 7.74.0-1)
[2020-12-12T10:07:16+0100] [ALPM] upgraded imagemagick (7.0.10.46-1 -> 7.0.10.48-1)
[2020-12-12T10:07:16+0100] [ALPM] upgraded plocate (1.0.7-1 -> 1.1.2-1)
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET] plocate now provides it's own "updatedb". plocate-build.service is deprecated
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET] and should be removed. Enable plocate-updatedb.service.
[2020-12-12T10:07:16+0100] [ALPM] upgraded python-cryptography (3.3-1 -> 3.3.1-1)
[2020-12-12T10:07:16+0100] [ALPM] transaction completed
[2020-12-12T10:07:16+0100] [ALPM] running '20-systemd-sysusers.hook'...
[2020-12-12T10:07:16+0100] [ALPM] running '30-systemd-daemon-reload.hook'...
[2020-12-12T10:07:16+0100] [ALPM-SCRIPTLET]   Skipped: Current root is not booted.
[2020-12-12T10:07:16+0100] [ALPM] running '30-systemd-tmpfiles.hook'...
[2020-12-12T10:07:16+0100] [ALPM] running '30-systemd-update.hook'...
[2020-12-12T10:07:16+0100] [ALPM] running 'detect-old-perl-modules.hook'...

EDIT:
I already tried downloading curl previous version, but of course installing it using pacman is impossible since the previous error. Also, trying to change the Xref sections of pacman.conf to use wget didn't work either.

EDIT2:
Apparently, it did it to also other upgraded libraries

>ll /usr/lib/liblz4.so*
lrwxrwxrwx 1 root root 15 Dec  8 17:35 /usr/lib/liblz4.so -> liblz4.so.1.9.3
lrwxrwxrwx 1 root root 15 Dec  8 17:35 /usr/lib/liblz4.so.1 -> liblz4.so.1.9.3
-rwxr-xr-x 1 root root  0 Dec  8 17:35 /usr/lib/liblz4.so.1.9.3

EDIT3:
Indeed, by checking the files in /var/cache/pacman/pkg/, I have this

-rw-r--r-- 1 root root     0 Dec 10 21:04 archlinux-keyring-20201210-1-any.pkg.tar.zst
-rw-r--r-- 1 root root     0 Dec  9 10:24 curl-7.74.0-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root     0 Dec 10 23:03 imagemagick-7.0.10.48-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root     0 Dec  8 17:35 lz4-1:1.9.3-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root     0 Dec 10 20:37 plocate-1.1.2-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root     0 Dec 10 20:18 python-cryptography-3.3.1-1-x86_64.pkg.tar.zst

Last edited by tigerjack (2020-12-22 08:56:19)

Offline

#2 2020-12-12 11:38:41

tigerjack
Member
Registered: 2017-08-20
Posts: 53

Re: [SOLVED] - Curl (and pacman) broken after latest upgrade

I kind of solved the problem.
I downloaded the lz and curl packages from archive. Then, sinze lz4 was broken also, I used python to decompress the zst files (through the zstandard module). You can find more infos on how to decompress a zst file here.

Then I just uncompressed the resulting tar files in the /usr directory. Not sure if more steps are needed, but for now it worked.

Later, I tried to reinstall the other broken files and that's what I got

sudo pacman -S archlinux-keyring imagemagick plocate python-cryptography                                                               
warning: archlinux-keyring-20201210-1 is up to date -- reinstalling                                                                                         
warning: imagemagick-7.0.10.48-1 is up to date -- reinstalling                                                                                              
warning: plocate-1.1.2-1 is up to date -- reinstalling                                                                                                      
warning: python-cryptography-3.3.1-1 is up to date -- reinstalling                                                                                          
resolving dependencies...                                                                                                                                   
looking for conflicting packages...                                                                                                                                                                                                                                                                                     
Packages (4) archlinux-keyring-20201210-1  imagemagick-7.0.10.48-1  plocate-1.1.2-1  python-cryptography-3.3.1-1                                                                              Total Installed Size:  14.05 MiB\n\n                                                                            :: 
:: Proceed with installation? [Y/n] Y\n                 
(4/4) checking keys in keyring                                                                
[#######################################################] 100%
downloading required keys...
:: Import PGP key 6D42BDD116E0068F, "Christian Hesse <arch@eworm.de>"? [Y/n] Y                                                                              
:: Import PGP key 7A4E76095D8A52E4, "Antonio Rojas <arojas@archlinux.org>"? [Y/n] Y                                                                         
:: Import PGP key E742683BA08CB2FF, "Morten Linderud <foxboron@archlinux.org>"? [Y/n] Y                                                                     
:: Import PGP key 786C63F330D7CB92, "Felix Yan <felixonmars@archlinux.org>"? [Y/n] Y                                                                        
(4/4) checking package integrity                                                              
[#######################################################] 100%
error: archlinux-keyring: signature from "Christian Hesse (Arch Linux Package Signing) <arch@eworm.de>" is invalid                                          
:: File /var/cache/pacman/pkg/archlinux-keyring-20201210-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).                     
Do you want to delete it? [Y/n] Y                     
error: imagemagick: signature from "Antonio Rojas <arojas@archlinux.org>" is invalid                                                                        
:: File /var/cache/pacman/pkg/imagemagick-7.0.10.48-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).                       
Do you want to delete it? [Y/n] Y                     
error: plocate: signature from "Morten Linderud <foxboron@archlinux.org>" is invalid                                                                        
:: File /var/cache/pacman/pkg/plocate-1.1.2-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).                               
Do you want to delete it? [Y/n] Y
error: python-cryptography: signature from "Felix Yan <felixonmars@archlinux.org>" is invalid                                                               
:: File /var/cache/pacman/pkg/python-cryptography-3.3.1-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).                   
Do you want to delete it? [Y/n] Y
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.

Last edited by tigerjack (2020-12-12 11:49:53)

Offline

#3 2020-12-12 11:40:29

xerxes_
Member
Registered: 2018-04-29
Posts: 665

Re: [SOLVED] - Curl (and pacman) broken after latest upgrade

Check if your wget is non zero size and uncomment wget in /etc/pacman.conf in [options] section and then try to reinstall curl and update system.

Offline

#4 2020-12-12 11:45:00

tigerjack
Member
Registered: 2017-08-20
Posts: 53

Re: [SOLVED] - Curl (and pacman) broken after latest upgrade

xerxes_ wrote:

Check if your wget is non zero size and uncomment wget in /etc/pacman.conf in [options] section and then try to reinstall curl and update system.

Already did it, it's in the first edit of OP.

Offline

#5 2020-12-12 12:34:51

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [SOLVED] - Curl (and pacman) broken after latest upgrade

Follow Pacman#Pacman_crashes_during_an_upgrade.
Replace step 4 with

pacman --root /mnt -Syu --cachedir=/mnt/var/cache/pacman/pkg

Similarly adjust step 6.

Offline

#6 2020-12-13 03:47:57

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] - Curl (and pacman) broken after latest upgrade

Note also https://aur.archlinux.org/packages/pacman-static can be used instead of core/pacman to download and reinstall packages. It does assume you've got enough of a working system to download the pacman-static binary linked in the pinned comment, though. wink

The installation media is a more reliable recovery method as it doesn't rely on your broken system to have a working shell, wget, internet, etc.

...

There are a couple different ways for your system to break like this. Unexpected forced poweroff could prevent the filesystem from sync()ing changes to disk, pacman could crash during an update, or, your hard drive could be failing. The last case is not really fixable by reinstalling, as it will just occur again and again.

It's most likely (usually turns out to be) forced poweroff at the wrong time. If you poweroff mid update, "sorry to hear it", but personally I use the following pacman hook to ensure "pacman -Syu" only exits successfully after writing all changes to disk:

$ cat /etc/pacman.d/hooks/zz-sync.hook 
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = *

[Action]
Description = Force syncing all files to disk
Depends = coreutils
When = PostTransaction
Exec = /usr/bin/sync

In case you're in the habit of "pacman -Syu && pull_the_cord_instead_of_clicking_shutdown" (I do not advise this) you'd only run the risk of losing files you modified *after* the -Syu completed, e.g. personal data but not your means of rebooting successfully.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2020-12-13 09:45:53

tigerjack
Member
Registered: 2017-08-20
Posts: 53

Re: [SOLVED] - Curl (and pacman) broken after latest upgrade

Thanks to both of you for the support, I will try to reinstall through the crash method as soon as I'll have time. This is definitely strange, I didn't do anything in particular, and I don't remember shutting down the laptop right after an update.
I quickly tried the pacman-static method, but I can't install it since it requires importing a PGP signature that I don't have and, apparently, none of them can be imported.

Offline

#8 2020-12-21 09:24:12

tigerjack
Member
Registered: 2017-08-20
Posts: 53

Re: [SOLVED] - Curl (and pacman) broken after latest upgrade

Ok, it seems that the problem was simply due to a missing ~/.gnupg directory (or pubring.kbx file). I noticed it in the output of

$>gpg --search-keys abcdefghij                                                                                                     
gpg: directory '/home/simone/.gnupg' created                                                                                                                
gpg: keybox '/home/simone/.gnupg/pubring.kbx' created                                                                                                       
gpg: data source: https://hkps.pool.sks-keyservers.net:443       
...

I still don't know why, but there was something wrong with the pacman gnupg keys. What solved the problem for me was

#>rm -r /etc/pacman.d/gnupg
#>pacman-key --init
#>pacman-key --populate archlinux
#>pacman-key --refresh
#>pacman -Syu

Last edited by tigerjack (2020-12-22 08:55:53)

Offline

#9 2020-12-21 13:36:12

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] - Curl (and pacman) broken after latest upgrade

Please remember to mark your thread [SOLVED] (edit the title of your first post).


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

Board footer

Powered by FluxBB