Difference between revisions of "Pacman troubleshooting"

Removed confusing section - perhaps obsolete - rewritten with tried and tested commands
m (adding a note)
(Removed confusing section - perhaps obsolete - rewritten with tried and tested commands)
Line 85: Line 85:
{{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! }}


<!--T:26-->
{{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.}}
'''1. Remove old (and possibly broken) keys''' by entering this command:
{{UserCmd|command=sudo rm -r /etc/pacman.d/gnupg}}
 
<!--T:27-->
'''2. Reinstall keyrings including the latest keys''':
{{UserCmd|command=sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring}}
 
<!--T:29-->
'''3. Initialize the pacman keyring''':
{{UserCmd|command=sudo pacman-key --init}}


<!--T:31-->
{{BoxInfo|Info|Those running ARM can find the '''archlinuxarm-keyring''' and '''manjaro-arm-keyring''' in the '''sync-arm''' and '''overlay-arm''' folders respectively.}}
'''4. Load the signature keys''':
{{UserCmd|command=sudo pacman-key --populate archlinux manjaro}}


<!--T:33-->
'''Download the new keyring packages'''
'''5. Refresh and update the signature keys'''(this might take quite a while):
Before you download ensure no keyring packages is in the current folder.
{{UserCmd|command=sudo pacman-key --refresh-keys}}
{{UserCmd|command=rm manjaro-keyring* archlinux-keyring*}}


<!--T:35-->
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.
'''6. Clear out the software packages downloaded during the aborted installation''' (optional):
{{UserCmd|command=sudo pacman -Sc}}</s>


<!--T:85-->
{{UserCmd|command=curl -O https://mirror.easyname.at/manjaro/pool/overlay/manjaro-keyring-YYYYMMDD-R-any.pkg.tar.xz}}
{{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.}}
{{UserCmd|command=curl -O https://mirror.easyname.at/manjaro/pool/sync/archlinux-keyring-YYYYMMDD-R-any.pkg.tar.zst}}


<!--T:86-->
'''Remove the dysfunctional keyrings''' by entering this command:
'''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}}


<!--T:87-->
'''Initialize the pacman keyring''':
'''2. Initialize the pacman keyring''':
{{UserCmd|command=sudo pacman-key --init}}
{{UserCmd|command=sudo pacman-key --init}}


<!--T:88-->
'''Install the downloaded packages'''
'''3. Download the 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
{{BoxInfo|Info| GPG check errors can be ignored, since it only downloads the keyring packages.
{{UserCmd|command=sudo pacman -U manjaro-keyring*.pkg.tar.xz archlinux-keyring*.pkg.tar.zst}}
 
<!--T:93-->
Those running ARM may also need to download archlinuxarm-keyring and manjaro-arm-keyring.
 
<!--T:94-->
}}
{{UserCmd|command=mkdir -pv $HOME/.cache/pkg/ && sudo pacman -Syw archlinux-keyring manjaro-keyring --cachedir $HOME/.cache/pkg/}}
 
<!--T:89-->
'''4. Remove the signatures:'''
{{BoxInfo|Info| Signatures must be removed to avoid the automatic check of the packages.}}
{{UserCmd|command=rm -f $HOME/.cache/pkg/*.sig}}


<!--T:90-->
'''Populate the keyrings''' - (optional as the install process will do that)
'''5. Install the downloaded packages manually:
{{UserCmd|command=sudo pacman-key --populate manjaro archlinux}}
{{BoxInfo|Info|This will also trigger the populate process.}}
{{UserCmd|command=sudo pacman -U $HOME/.cache/pkg/*.tar.zst}}
{{UserCmd|command=sudo pacman -U $HOME/.cache/pkg/*.tar.xz}}


<!--T:91-->
'''Clear out the software packages downloaded during the aborted installation''' (optional):  
'''6. Clear out the software packages downloaded during the aborted installation''' (optional):  
{{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.}}
{{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}}


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


== Conflicting files - ''FILENAME'' exists in filesystem == <!--T:39-->
== Conflicting files - ''FILENAME'' exists in filesystem == <!--T:39-->
Moderators, translator
455

edits