You are not logged in.

#1 2013-05-14 12:15:01

chronozphere
Member
Registered: 2011-06-18
Posts: 18

Downloaded glibc is corrupt when upgrading

Hi everybody,

I have got issues with a freshly installed VPS. I get the following when attempting to upgrade pacman:

error: glibc: signature from "Allan McRae <me@allanmcrae.com>" is invalid
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

So I have tried a lot of stuff, including:

pacman-key --init
pacman-key --populate archlinux
pacman -Syy
and pacman-key --refresh-keys

Then I found this thread: https://bbs.archlinux.org/viewtopic.php?id=136507
So I have set SigLevel to Never and now pacman reports that the glibc package is corrupted.
It looks like this:

 resolving dependencies...
looking for inter-conflicts...

Targets (6): bash-4.2.045-1  filesystem-2013.03-2  glibc-2.17-5
             libarchive-3.1.2-1  lzo2-2.06-1  pacman-4.1.1-1

Total Download Size:    7.92 MiB
Total Installed Size:   46.90 MiB
Net Upgrade Size:       -1.18 MiB

Proceed with installation? [Y/n] Y
:: Retrieving packages from core...
 glibc-2.17-5-x86_64        7.9 MiB  1601K/s 00:05 [######################] 100%
(6/6) checking package integrity                   [######################] 100%
:: File /var/cache/pacman/pkg/glibc-2.17-5-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (checksum)).
Do you want to delete it? [Y/n] Y
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

So I decided to pick another mirror using /etc/pacman.d/mirrorlist.
Then I cleared the cache with pacman -Scc and did another pacman -Syy and pacman -Syu.
This is the result:

[root@vps542 ~]# vim /etc/pacman.d/mirrorlist 
[root@vps542 ~]# pacman -Scc
Cache directory: /var/cache/pacman/pkg/
Do you want to remove ALL files from cache? [y/N] y
removing all files from cache...

Database directory: /var/lib/pacman/
Do you want to remove unused repositories? [Y/n] Y
removing unused sync repositories...
[root@vps542 ~]# pacman -Syy
:: Synchronizing package databases...
 core                     105.2 KiB  13.0M/s 00:00 [######################] 100%
 extra                   1426.1 KiB  22.7M/s 00:00 [######################] 100%
 community               1948.3 KiB  25.3M/s 00:00 [######################] 100%
[root@vps542 ~]# pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: The following packages should be upgraded first :
    pacman
:: Do you want to cancel the current operation
:: and upgrade these packages now? [Y/n] Y

resolving dependencies...
looking for inter-conflicts...

Targets (6): bash-4.2.045-1  filesystem-2013.03-2  glibc-2.17-5
             libarchive-3.1.2-1  lzo2-2.06-1  pacman-4.1.1-1

Total Download Size:    9.95 MiB
Total Installed Size:   46.90 MiB
Net Upgrade Size:       -1.18 MiB

Proceed with installation? [Y/n] Y
:: Retrieving packages from core...
 filesystem-2013.03-...     5.9 KiB   104M/s 00:00 [######################] 100%
 glibc-2.17-5-x86_64        7.9 MiB  21.1M/s 00:00 [######################] 100%
 bash-4.2.045-1-x86_64    789.1 KiB  24.5M/s 00:00 [######################] 100%
 lzo2-2.06-1-x86_64        73.5 KiB  33.2M/s 00:00 [######################] 100%
 libarchive-3.1.2-1-...   595.4 KiB  30.1M/s 00:00 [######################] 100%
 pacman-4.1.1-1-x86_64    622.9 KiB  27.9M/s 00:00 [######################] 100%
(6/6) checking package integrity                   [######################] 100%
(6/6) loading package files                        [######################] 100%
error: error while reading package /var/cache/pacman/pkg/glibc-2.17-5-x86_64.pkg.tar.xz: Truncated input file (needed 129536 bytes, only 0 available)
error: failed to commit transaction (libarchive error)
Errors occurred, no packages were upgraded.

What is happening here? Can somebody enlighten me?

Thank you!

Offline

#2 2013-05-14 18:16:15

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Downloaded glibc is corrupt when upgrading


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-05-27 08:17:42

chronozphere
Member
Registered: 2011-06-18
Posts: 18

Re: Downloaded glibc is corrupt when upgrading

Thanks for replying.

So, there may be two causes for this. Either problems with the signature or a real corrupted package. By setting SigLevel to Never I have ruled out the first one. So my glibc package seems to be corrupted on every retry O.o.

When I do pacman --debug -S glibc I get:

debug: found cached pkg: /var/cache/pacman/pkg/glibc-2.17-5-x86_64.pkg.tar.xz
debug: sha256sum: f036037784052aecf799ef0ff4fbc6256780056667480e56ef6ef083c8b4bb14
debug: checking sha256sum for /var/cache/pacman/pkg/glibc-2.17-5-x86_64.pkg.tar.xz
debug: returning error 34 from _alpm_pkg_validate_internal : invalid or corrupted package (checksum)
:: File /var/cache/pacman/pkg/glibc-2.17-5-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (checksum)).
Do you want to delete it? [Y/n] 

I've repeated the following a couple of times:

pacman -Sc
pacman -S glibc
sha256sum /var/cache/pacman/pkg/glibc-2.17-5-x86_64.pkg.tar.xz

And this is the result:

afd2b18c103382b48acbd8c79e4a6aa5196dbc3ebe58717502939268ba62a051
62735a8d765e6a3f88dbb505473fdec4a5e2b3ee9a3d54296bf49c3f14c355b9
5878b3cdf8be08140d8735cfc57a55b4829711a425316f61d0eaf852d0386254

The filesizes do match all the time, but the contents change. My understanding is that packages are just static files served by the mirrors so this is definitely strange.

The right one should be (by taking the hash from the same package on my other server).

f036037784052aecf799ef0ff4fbc6256780056667480e56ef6ef083c8b4bb14

This is driving me nuts! How can a single package get corrupted while others install without problems. I have upgraded vim and installed git without any issues.

Does somebody have a clue?

Offline

#4 2013-05-27 09:11:21

chronozphere
Member
Registered: 2011-06-18
Posts: 18

Re: Downloaded glibc is corrupt when upgrading

I seem to have fixed it! big_smile

After many experiments I tried to untar the package, which did not work (Unexpected EOF so it seemed corrupted). However, the same package (with same sha256 checksum) could be extracted on my other server. This made me reinstall "tar". After that, I could untar the package and I could also upgrade glibc by just using pacman.

Offline

Board footer

Powered by FluxBB