Skip to content

Instantly share code, notes, and snippets.

@korikori
Last active April 7, 2026 16:25
Show Gist options
  • Select an option

  • Save korikori/bca45ddc2e69903aa3a5aa3da42ffd9a to your computer and use it in GitHub Desktop.

Select an option

Save korikori/bca45ddc2e69903aa3a5aa3da42ffd9a to your computer and use it in GitHub Desktop.
Fix a botched package on Arch Linux

Sometimes a failed update (due to an unexpected power outage or similar) on Arch Linux may lead to a botched package that is difficult to reinstall due to errors of this type:

perl: /usr/bin/core_perl/corelist exists in filesystem
perl: /usr/bin/core_perl/cpan exists in filesystem

Since pacman no longer has a force option, here is how to fix this:

  1. Trying to update the affected package will list all conflicting files - save them to a file:

     sudo pacman -S perl 2>perl-errors.txt
    
  2. Extract the filenames:

     awk '{print $2}' perl-errors.txt > perl-filelist.txt
    
  3. Delete the conflicting files:

     for f in $(cat perl-filelist.txt) ; do sudo rm "$f" ; done
    

You can now reinstall the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment