Difference between revisions of "Pacman troubleshooting/en"

Updating to match new version of source page
(Updating to match new version of source page)
(Updating to match new version of source page)
 
Line 15: Line 15:
  error: could not open file /var/lib/pacman/sync/multilib.db: Unrecognized archive format
  error: could not open file /var/lib/pacman/sync/multilib.db: Unrecognized archive format


The error relates to a mismatch in the information contained in the db files at the mentioned location and the db files at the first mirror in your mirrorlist. Pacman checks a package in the database and sees if the signature file matches the one in the database. If it does not, then pacman will say the package is corrupted.
The error relates to content of the db files. The error happens when pacman receives markup from the mirror instead of the database archives.


While it sometimes is possible to fix the issue simply by deleting the files and the running a pacman update it far from every time.
While it sometimes is possible to fix the issue simply by deleting the files and the running a pacman update it far from every time.


=== One recipe for fixing this ===
'''Run pacman-mirrors to refresh your mirrorlist'''
 
{{UserCmd|command=sudo pacman-mirrors -c Global}}
It is mandatory to ensure that the keyrings is current. By ensuring the keyrings are in shape and then redownloading the databases we reestablish the chain of trust between the keyrings and the packages.
 
'''You will have to find the correct names by looking at'''
Browse [https://mirror.easyname.at/manjaro/pool/overlay/ https://mirror.easyname.at/manjaro/pool/overlay/] for the current manjaro-keyring
and
Browse [https://mirror.easyname.at/manjaro/pool/sync https://mirror.easyname.at/manjaro/pool/sync] for the current archlinux-keyring
 
'''Replace yyyymmdd and x with the info found at the above links'''
 
{{UserCmd|command=sudo pacman -U <nowiki>https://mirror.easyname.at/manjaro/pool/overlay/manjaro-keyring-yyyymmdd-x-any.pkg.tar.xz</nowiki>}}
{{UserCmd|command=sudo pacman -U <nowiki>https://mirror.easyname.at/manjaro/pool/sync/archlinux-keyring-yyyymmdd-x-any.pkg.tar.xz</nowiki>}}
 
'''Remove your faulty databases'''
{{UserCmd|command=sudo rm -f /var/lib/pacman/sync/*}}


'''Download the databases and update the system'''
'''Download the databases and update the system'''
Line 64: Line 50:
{{Warning|The following commands only work, when your system time is set correctly! }}
{{Warning|The following commands only work, when your system time is set correctly! }}


'''1. Remove old (and possibly broken) keys''' by entering this command:
{{BoxInfo|Info|Retrieving the latest keyring packages can be done by browsing a current mirrors pool folder. E.g. from '''https://mirror.easyname.at/manjaro/pool''' - using the '''overlay''' for Manjaro keyring and '''sync''' for Arch keyring and downloading them to your system. Do not download '''.sig''' files.}}
{{UserCmd|command=sudo rm -r /etc/pacman.d/gnupg}}


'''2. Reinstall keyrings including the latest keys''':
{{BoxInfo|Info|Those running ARM can find the '''archlinuxarm-keyring''' and '''manjaro-arm-keyring''' in the '''sync-arm''' and '''overlay-arm''' folders respectively.}}
{{UserCmd|command=sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring}}


'''3. Initialize the pacman keyring''':
'''Download the new keyring packages'''
{{UserCmd|command=sudo pacman-key --init}}
Before you download ensure no keyring packages is in the current folder.
{{UserCmd|command=rm manjaro-keyring* archlinux-keyring*}}


'''4. Load the signature keys''':
Use either your browser or curl to download. Using curl assumes you know the correct package name as located with the mirror. Replace '''YYYYMMDD-R''' as available from the mirror.
{{UserCmd|command=sudo pacman-key --populate archlinux manjaro}}


'''5. Refresh and update the signature keys'''(this might take quite a while):
{{UserCmd|command=curl -O <nowiki>https://mirror.easyname.at/manjaro/pool/overlay/manjaro-keyring-YYYYMMDD-R-any.pkg.tar.xz</nowiki>}}
{{UserCmd|command=sudo pacman-key --refresh-keys}}
{{UserCmd|command=curl -O <nowiki>https://mirror.easyname.at/manjaro/pool/sync/archlinux-keyring-YYYYMMDD-R-any.pkg.tar.zst</nowiki>}}


'''6. Clear out the software packages downloaded during the aborted installation''' (optional):
'''Remove the dysfunctional keyrings''' by entering this command:
{{UserCmd|command=sudo pacman -Sc}}</s>
 
{{BoxInfo|Info|Improved version added, since it doesn't work that way above. The packages are signed and since '''/etc/pacman.d/gnupg''' has been removed, it cannot be installed due the check. Instead editing the '''/etc/pacman.conf''' and lowering the SigLevel, it would be better installing the keyrings without a check manually to overcome this problem.}}
 
'''1. Remove old (and possibly broken) keys''' by entering this command:
{{UserCmd|command=sudo rm -r /etc/pacman.d/gnupg}}
{{UserCmd|command=sudo rm -r /etc/pacman.d/gnupg}}


'''2. Initialize the pacman keyring''':
'''Initialize the pacman keyring''':
{{UserCmd|command=sudo pacman-key --init}}
{{UserCmd|command=sudo pacman-key --init}}


'''3. Download the packages:'''
'''Install the downloaded packages'''
{{BoxInfo|Info| GPG check errors can be ignored, since it only downloads the keyring packages.
Assuming the files is the current folder and using wildcard so you don't have to deal with dates and versions - remove the packages after successful installation
 
{{UserCmd|command=sudo pacman -U manjaro-keyring*.pkg.tar.xz archlinux-keyring*.pkg.tar.zst}}
Those running ARM may also need to download archlinuxarm-keyring and manjaro-arm-keyring.
 
}}
{{UserCmd|command=mkdir -pv $HOME/.cache/pkg/ && sudo pacman -Syw archlinux-keyring manjaro-keyring --cachedir $HOME/.cache/pkg/}}


'''4. Remove the signatures:'''
'''Populate the keyrings''' - (optional as the install process will do that)
{{BoxInfo|Info| Signatures must be removed to avoid the automatic check of the packages.}}
{{UserCmd|command=sudo pacman-key --populate manjaro archlinux}}
{{UserCmd|command=rm -f $HOME/.cache/pkg/*.sig}}


'''5. Install the downloaded packages manually:
'''Clear out the software packages downloaded during the aborted installation''' (optional):  
{{BoxInfo|Info|This will also trigger the populate process.}}
{{warning|The command clears the pacman cache completely, and one will not be able to downgrade to a previous version of a package if required. Instead packages that are causing signing errors can be removed individually when upgrading.}}
{{UserCmd|command=sudo pacman -U $HOME/.cache/pkg/*.tar.zst}}
{{UserCmd|command=sudo pacman -U $HOME/.cache/pkg/*.tar.xz}}
 
'''6. Clear out the software packages downloaded during the aborted installation''' (optional):  
{{warning|The above command clears the pacman cache completely, and one will not be able to downgrade to a previous version of a package if required. Instead packages that are causing signing errors can be removed individually when upgrading.}}
{{UserCmd|command=sudo pacman -Sc}}
{{UserCmd|command=sudo pacman -Sc}}


'''7. Remove the custom package folder:''' (optional):
After that try running '''sudo pacman -Syyu''' to see if the errors were resolved.
{{UserCmd|command=sudo rm -Rf $HOME/.cache/pkg/}}
 
After that try running '''sudo pacman -Syu''' to see if the errors were resolved.


== Conflicting files - ''FILENAME'' exists in filesystem ==
== Conflicting files - ''FILENAME'' exists in filesystem ==
8,138

edits