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 22: Line 22:


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.
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'''
'''You will have to find the correct names by looking at'''
  Browse [https://mirror.netzspielplatz.de/manjaro/packages/pool/overlay https://mirror.netzspielplatz.de/manjaro/packages/pool/overlay] for the current manjaro-keyring
  Browse [https://mirror.easyname.at/manjaro/pool/overlay/ https://mirror.easyname.at/manjaro/pool/overlay/] for the current manjaro-keyring
and
and
  Browse [https://mirror.netzspielplatz.de/manjaro/packages/pool/sync https://mirror.netzspielplatz.de/manjaro/packages/pool/sync] for the current archlinux-keyring
  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'''
'''Replace yyyymmdd and x with the info found at the above links'''


sudo pacman -U https://mirror.netzspielplatz.de/manjaro/packages/pool/overlay/manjaro-keyring-yyyymmdd-x-any.pkg.tar.xz
{{UserCmd|command=sudo pacman -U <nowiki>https://mirror.easyname.at/manjaro/pool/overlay/manjaro-keyring-yyyymmdd-x-any.pkg.tar.xz</nowiki>}}
sudo pacman -U https://mirror.netzspielplatz.de/manjaro/packages/pool/sync/archlinux-keyring-yyyymmdd-x-any.pkg.tar.xz
{{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'''
'''Remove your faulty databases'''
sudo rm -f /var/lib/pacman/sync/*
{{UserCmd|command=sudo rm -f /var/lib/pacman/sync/*}}
 
'''Download the databases and update the system'''
'''Download the databases and update the system'''
sudo pacman -Syyu
{{UserCmd|command=sudo pacman -Syyu}}


== "Unable to lock database" Error ==
== "Unable to lock database" Error ==
Line 47: Line 47:


It is therefore wise to first check to ensure that another installation is not (or had not been) in process at the time of the error. When satisfied that this is not the case, then the database lock file can be manually deleted. To do so, open up the terminal and enter the following command:
It is therefore wise to first check to ensure that another installation is not (or had not been) in process at the time of the error. When satisfied that this is not the case, then the database lock file can be manually deleted. To do so, open up the terminal and enter the following command:
 
{{UserCmd|command=sudo rm /var/lib/pacman/db.lck}}
sudo rm /var/lib/pacman/db.lck


Once done, you should now be able to successfully re-attempt your intended installation.
Once done, you should now be able to successfully re-attempt your intended installation.


== Errors about Keys ==
== Errors about Keys ==
Line 66: Line 64:
{{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! }}


<s>'''1. Remove old (and possibly broken) keys''' by entering this command:
'''1. Remove old (and possibly broken) keys''' by entering this command:
{{UserCmd|command=sudo rm -r /etc/pacman.d/gnupg}}
sudo rm -r /etc/pacman.d/gnupg  


'''2. Reinstall keyrings including the latest keys''':
'''2. Reinstall keyrings including the latest keys''':
{{UserCmd|command=sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring}}


sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring
'''3. Initialize the pacman keyring''':
 
{{UserCmd|command=sudo pacman-key --init}}
'''2. Initialize the pacman keyring''':
 
sudo pacman-key --init  


'''4. Load the signature keys''':
'''4. Load the signature keys''':
 
{{UserCmd|command=sudo pacman-key --populate archlinux manjaro}}
sudo pacman-key --populate archlinux manjaro  


'''5. Refresh and update the signature keys''':  
'''5. Refresh and update the signature keys''':  
 
{{UserCmd|command=sudo pacman-key --refresh-keys}}
sudo pacman-key --refresh-keys  


'''6. Clear out the software packages downloaded during the aborted installation''' (optional):  
'''6. Clear out the software packages downloaded during the aborted installation''' (optional):  
 
{{UserCmd|command=sudo pacman -Sc}}</s>
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.}}
{{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:
'''1. Remove old (and possibly broken) keys''' by entering this command:
{{UserCmd|command=sudo rm -r /etc/pacman.d/gnupg}}
sudo rm -r /etc/pacman.d/gnupg  


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


'''3. Download the packages:'''
'''3. Download the packages:'''
{{BoxInfo|Info| GPG check errors can be ignored, since it only downloads the keyring packages.}}
{{BoxInfo|Info| GPG check errors can be ignored, since it only downloads the keyring packages.
 
mkdir -pv $HOME/.cache/pkg/ && sudo pacman -Syw archlinux-keyring manjaro-keyring --cachedir $HOME/.cache/pkg/
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:'''
'''4. Remove the signatures:'''
{{BoxInfo|Info| Signatures must be removed to avoid the automatic check of the packages.}}
{{BoxInfo|Info| Signatures must be removed to avoid the automatic check of the packages.}}
{{UserCmd|command=rm -f $HOME/.cache/pkg/*.sig}}
rm -f $HOME/.cache/pkg/*.sig


'''5. Install the downloaded packages manually:
'''5. Install the downloaded packages manually:
{{BoxInfo|Info|This will also trigger the populate process.}}
{{BoxInfo|Info|This will also trigger the populate process.}}
sudo pacman -U $HOME/.cache/pkg/*.tar.zst
{{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):  
'''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.}}
{{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}}
sudo pacman -Sc
 
'''7. Remove the custom package folder:''' (optional):  
'''7. Remove the custom package folder:''' (optional):  
{{UserCmd|command=sudo rm -Rf $HOME/.cache/pkg/}}
sudo rm -Rf $HOME/.cache/pkg/
 


After that try running '''sudo pacman -Syu''' to see if the errors were resolved.
After that try running '''sudo pacman -Syu''' to see if the errors were resolved.
Line 149: Line 139:
The first step is to identify which, if any, package owns the file. This can be easily done with:
The first step is to identify which, if any, package owns the file. This can be easily done with:


pacman -Qo /path/to/file
{{UserCmd|command=pacman -Qo /path/to/file}}


If this identifies a conflicting package you can decide to remove it with pacman -R. If no package is identified you can delete the file (or move it to a backup location).
If this identifies a conflicting package you can decide to remove it with pacman -R. If no package is identified you can delete the file (or move it to a backup location).
Line 183: Line 173:
1. Download the package databases and update your system:
1. Download the package databases and update your system:


  sudo pacman -Syyu
  {{UserCmd|command=sudo pacman -Syyu}}


2. Clear out the software packages downloaded during the aborted installation by entering the command:  
2. Clear out the software packages downloaded during the aborted installation by entering the command:  


  sudo pacman -Sc
  {{UserCmd|command=sudo pacman -Sc}}


3. Re-attempt the aborted download.
3. Re-attempt the aborted download.
Line 194: Line 184:


If the basic proceedure still does not resolve the matter, further steps are available:
If the basic proceedure still does not resolve the matter, further steps are available:


1. Resynchronise with the Manjaro servers to ensure that everything is up to date by entering the command:
1. Resynchronise with the Manjaro servers to ensure that everything is up to date by entering the command:
 
{{UserCmd|command=sudo pacman -Syy}}
sudo pacman -Syy


2. Refresh and update the signature keys by entering the command:
2. Refresh and update the signature keys by entering the command:
 
{{UserCmd|command=sudo pacman-key --refresh-keys}}
sudo pacman-key --refresh-keys


3. Reload the signature keys by entering the command:
3. Reload the signature keys by entering the command:
 
{{UserCmd|command=sudo pacman-key --populate archlinux manjaro}}
sudo pacman-key --populate archlinux manjaro


4. Clear out the software packages downloaded during the aborted installation by entering the command:  
4. Clear out the software packages downloaded during the aborted installation by entering the command:  
 
{{UserCmd|command=sudo pacman -Sc}}
sudo pacman -Sc


5. Re-attempt the aborted download.
5. Re-attempt the aborted download.


 
If the error still persists, then it is recommended to '''[[Change to a Different Download Server|Change to a Different Download Server]]'''.
If the error still persists, then it is recommended to '''[[Change to a Different Download Server]]'''.




Line 221: Line 205:


Try running the following command:
Try running the following command:
 
{{UserCmd|command=sudo dirmngr <nowiki></dev/null</nowiki>}}
sudo dirmngr </dev/null
 


= See Also =
= See Also =


* '''[[Change to a Different Download Server]]'''
* '''[[Change to a Different Download Server|Change to a Different Download Server]]'''
* '''[[Pacman-mirrors|Reference Guide for pacman-mirrors]]'''
* '''[[Pacman-mirrors|Reference Guide for pacman-mirrors]]'''
* '''[https://wiki.archlinux.org/index.php/Pacman#Troubleshooting Arch wiki for more comprehensive troubleshooting]'''
* '''[https://wiki.archlinux.org/index.php/Pacman#Troubleshooting Arch wiki for more comprehensive troubleshooting]'''
[[Category:Contents Page{{#translation:}}]]
[[Category:Contents Page{{#translation:}}]]
8,138

edits