What to do about corrupted package?

Discussion in 'all things UNIX' started by wat0114, Apr 13, 2015.

  1. wat0114

    wat0114 Registered Member

    Joined:
    Aug 5, 2012
    Posts:
    1,983
    Location:
    Canada
    does anyone know how to deal with something like the below...

    Code:
    :: File /var/cache/pacman/pkg/dhcpcd-6.8.1-1-i686.pkg.tar.xz 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.
    
    ...other than simply ignore it ("--ignore" flag) as I've been doing?
     
  2. tlu

    tlu Guest

    Have you tried to re-install the package? Just noticed that this is the 32bit version - aren't you running a 64bit system?

    If that fails there might be a problem with the mirror used by you. You might try to execute

    Code:
    sudo rm -R /var/lib/pacman/sync
    and then resync with

    Code:
    sudo pacman -Syu
    EDIT: Another possible solution.
     
    Last edited by a moderator: Apr 14, 2015
  3. wat0114

    wat0114 Registered Member

    Joined:
    Aug 5, 2012
    Posts:
    1,983
    Location:
    Canada
    Thank you for the suggestions tlu. Unfortunately neither one worked. I'm using a 32 bit Arch on one machine and 64 bit on another, and the problem occurs on both. I even deleted the package manually then tried to re-install with sudo pacman -S dhcp but to no avail.
     
  4. tlu

    tlu Guest

    In this case I assume that there is a problem with your mirror. I suggest that you check if it's one of the successfully syncing mirrors. My recommendation is to use the excellent Reflector script that ensures that your mirrorlist always contains the fastest and most reliable mirrors. I'm running the following script in /etc/cron.hourly :

    Code:
    #!/bin/bash
    cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
    reflector -c DE -c FR -c DK -c NL -c NO -l 20 -p http --sort score --fastest 10 --threads 2 --save /etc/pacman.d/reflectormirrorlist
    You have to replace the country codes with the ones fitting for you, of course, or simply remove them at all.

    EDIT: A more detailed description of the Reflector syntax/options is here.
    EDIT2: Just as an example - my current mirrorlist looks like this:

    Code:
    ################################################################################
    ################# Arch Linux mirrorlist generated by Reflector #################
    ################################################################################
    
    # With:       reflector -c DE -c FR -c DK -c NL -c NO -l 20 -p http --sort score --fastest 10 --threads 2 --save /etc/pacman.d/reflectormirrorlist
    # When:       2015-04-15 09:01:18 UTC
    # From:       https://www.archlinux.org/mirrors/status/json/
    # Retrieved:  2015-04-15 09:01:04 UTC
    # Last Check: 2015-04-15 08:38:34 UTC
    
    Server = http://mirror.one.com/archlinux/$repo/os/$arch
    Server = http://archlinux.my-universe.com/$repo/os/$arch
    Server = http://os-sharing.org/archlinux/$repo/os/$arch
    Server = http://mirror.lightcone.eu/archlinux/$repo/os/$arch
    Server = http://archlinux.honkgong.info/$repo/os/$arch
    Server = http://mirror.tyborek.pl/arch/$repo/os/$arch
    Server = http://archlinux.limun.org/$repo/os/$arch
    Server = http://archlinux.mailtunnel.eu/$repo/os/$arch
    Server = http://arch.yourlabs.org/$repo/os/$arch
    Server = http://archlinux.mirror.pkern.at/$repo/os/$arch
     
    Last edited by a moderator: Apr 15, 2015
  5. wat0114

    wat0114 Registered Member

    Joined:
    Aug 5, 2012
    Posts:
    1,983
    Location:
    Canada
    hi Thomas,

    I ran the Reflector command which generated a new mirrorlist, I backed up my old one, ran sudo pacman -Syu but the same problem again :( I even deleted the previous dhcpcd version, tried re-installing, but no luck again. Even tried the AUR install (yaourt dhcpcd) and same problem. Maybe some problem with the region i'm in?? who knows, just an odd problem. Maybe eventually I'll come up with something. Thanks again for your help :thumb:
     
  6. tlu

    tlu Guest

    This is really strange ... :confused:

    Have you tried to manually download the packages from here and here by clicking "Download From Mirror" and to install them with sudo pacman -U ... ?

    I don't think so. Reflector should give you the best mirrors available. But you can try to omit the country codes at all and just execute

    Code:
    reflector -l 20 -p http --sort score --fastest 10 --save /etc/pacman.d/reflectormirrorlist
    to get you the best mirrors from all over the world.
     
  7. wat0114

    wat0114 Registered Member

    Joined:
    Aug 5, 2012
    Posts:
    1,983
    Location:
    Canada
    Well I Googled a bit and found a solution, even it's not the best one. I temporarily added SigLevel=Never under the Core repository line in the pacman.conf file, then just installed dhcpcd, so it didn't check the package signature before installing. This was quite a baffling problem but at least it didn't cause any usability grief :) Thanks again for your help, Thomas. Much appreciated.

    BTW, I sure like the new mirrorlist the Reflector command generated. The refreshes seem to be the fastest I've seen yet.
     
  8. tlu

    tlu Guest

    Okay, but please revert this setting again. - I still don't really understand what happened to you. Did you also try to manually download the packages?

    Yes, Reflector is really good. BTW, I just noticed that my examples were rather misleading: the option

    Code:
    --save /etc/pacman.d/reflectormirrorlist
    should actually read

    Code:
    --save /etc/pacman.d/mirrorlist
    Sorry for that! The reason was that I'm currently testing delta updates . I created a mirrorlist called deltamirrorlist

    Code:
    Server = http://delta.archlinux.fr/$repo/os/$arch
    and a second one called reflectormirrorlist. So the complete script in cron.hourly is actually

    Code:
    #!/bin/bash
    
    cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
    reflector -c DE -c FR -c DK -c NL -c NO -l 20 -p http --sort score --fastest 10 --threads 2 --save /etc/pacman.d/reflectormirrorlist
    cat /etc/pacman.d/deltamirrorlist /etc/pacman.d/reflectormirrorlist > /etc/pacman.d/mirrorlist
    I had forgotten to edit for you. I sincerely hope that you were not too confused :doubt:
     
  9. wat0114

    wat0114 Registered Member

    Joined:
    Aug 5, 2012
    Posts:
    1,983
    Location:
    Canada
    I reverted to the previous setting after the install. I didn't try the manual download because it looks to be the same package as the one obtained through pacman.


    Thanks Thomas, no harm was done or real confusion on my part :)
     
  10. wat0114

    wat0114 Registered Member

    Joined:
    Aug 5, 2012
    Posts:
    1,983
    Location:
    Canada
Loading...