Manjaro Difference between revisions of "Pacman troubleshooting"

Difference between revisions of "Pacman troubleshooting"

From Manjaro
(add nowiki tag to part of command)
(implemented command templates - cleanup)
Line 13: Line 13:
[https://forum.manjaro.org/t/pacman-could-not-open-file-sync-files/20046 Pacman could not open file: sync files]
[https://forum.manjaro.org/t/pacman-could-not-open-file-sync-files/20046 Pacman could not open file: sync files]


<!--T:5-->
<!--T:5-->
error: could not open file /var/lib/pacman/sync/core.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/core.db: Unrecognized archive format
  error: could not open file /var/lib/pacman/sync/extra.db: Unrecognized archive format
  error: could not open file /var/lib/pacman/sync/extra.db: Unrecognized archive format
  error: could not open file /var/lib/pacman/sync/community.db: Unrecognized archive format
  error: could not open file /var/lib/pacman/sync/community.db: Unrecognized archive format
Line 29: Line 29:
<!--T:9-->
<!--T:9-->
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.


<!--T:10-->
<!--T:10-->
'''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/packages/pool/overlay https://mirror.easyname.at/manjaro/packages/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/packages/pool/sync https://mirror.netzspielplatz.de/manjaro/packages/pool/sync] for the current archlinux-keyring


<!--T:11-->
<!--T:11-->
Line 41: Line 40:


<!--T:12-->
<!--T:12-->
{{UserCmd|command=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/packages/pool/overlay/manjaro-keyring-yyyymmdd-x-any.pkg.tar.xz</nowiki>}}
{{UserCmd|command=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/packages/pool/sync/archlinux-keyring-yyyymmdd-x-any.pkg.tar.xz</nowiki>}}


<!--T:13-->
<!--T:13-->
'''Remove your faulty databases'''
'''Remove your faulty databases'''
{{UserCmd|command=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'''
{{UserCmd|command=sudo pacman -Syyu}}
{{UserCmd|command=sudo pacman -Syyu}}
Line 61: Line 61:
<!--T:17-->
<!--T:17-->
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:
<!--T:18-->
{{UserCmd|command=sudo rm /var/lib/pacman/db.lck}}
{{UserCmd|command=sudo rm /var/lib/pacman/db.lck}}


<!--T:19-->
<!--T:19-->
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 == <!--T:20-->
== Errors about Keys == <!--T:20-->
Line 88: Line 85:


<!--T:26-->
<!--T:26-->
<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}}
{{UserCmd|command=sudo rm -r /etc/pacman.d/gnupg}}


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


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


<!--T:31-->
<!--T:31-->
'''4. Load the signature keys''':
'''4. Load the signature keys''':
<!--T:32-->
{{UserCmd|command=sudo pacman-key --populate archlinux manjaro}}
{{UserCmd|command=sudo pacman-key --populate archlinux manjaro}}


<!--T:33-->
<!--T:33-->
'''5. Refresh and update the signature keys''':  
'''5. Refresh and update the signature keys''':  
<!--T:34-->
{{UserCmd|command=sudo pacman-key --refresh-keys}}
{{UserCmd|command=sudo pacman-key --refresh-keys}}


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


Line 127: Line 113:
<!--T:86-->
<!--T:86-->
'''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}}
{{UserCmd|command=sudo rm -r /etc/pacman.d/gnupg}}


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


Line 142: Line 126:


}}
}}
{{UserCmd|command=mkdir -pv $HOME/.cache/pkg/ && sudo pacman -Syw archlinux-keyring manjaro-keyring --cachedir $HOME/.cache/pkg/}}
{{UserCmd|command=mkdir -pv $HOME/.cache/pkg/ && sudo pacman -Syw archlinux-keyring manjaro-keyring --cachedir $HOME/.cache/pkg/}}


Line 148: Line 131:
'''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}}
{{UserCmd|command=rm -f $HOME/.cache/pkg/*.sig}}


Line 160: Line 142:
'''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}}
{{UserCmd|command=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/}}
{{UserCmd|command=sudo rm -Rf $HOME/.cache/pkg/}}


<!--T:38-->
<!--T:38-->
Line 176: Line 155:
'''If you cant can't install or update a package because of an error like this:'''
'''If you cant can't install or update a package because of an error like this:'''


<!--T:41-->
<!--T:41-->
error: could not prepare transaction
error: could not prepare transaction
  error: failed to commit transaction (conflicting files)
  error: failed to commit transaction (conflicting files)
  libname: /insert/file/name/here exists in filesystem
  libname: /insert/file/name/here exists in filesystem
Line 203: Line 182:
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:


<!--T:49-->
<!--T:49-->
{{UserCmd|command=pacman -Qo /path/to/file}}
{{UserCmd|command=pacman -Qo /path/to/file}}


Line 266: Line 245:
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:


<!--T:70-->
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:
<!--T:71-->
{{UserCmd|command=sudo pacman -Syy}}
{{UserCmd|command=sudo pacman -Syy}}


<!--T:72-->
<!--T:72-->
2. Refresh and update the signature keys by entering the command:
2. Refresh and update the signature keys by entering the command:
<!--T:73-->
{{UserCmd|command=sudo pacman-key --refresh-keys}}
{{UserCmd|command=sudo pacman-key --refresh-keys}}


<!--T:74-->
<!--T:74-->
3. Reload the signature keys by entering the command:
3. Reload the signature keys by entering the command:
<!--T:75-->
{{UserCmd|command=sudo pacman-key --populate archlinux manjaro}}
{{UserCmd|command=sudo pacman-key --populate archlinux manjaro}}


<!--T:76-->
<!--T:76-->
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:  
<!--T:77-->
{{UserCmd|command=sudo pacman -Sc}}
{{UserCmd|command=sudo pacman -Sc}}


Line 302: Line 271:
<!--T:81-->
<!--T:81-->
Try running the following command:
Try running the following command:
<!--T:82-->
{{UserCmd|command=sudo dirmngr <nowiki></dev/null</nowiki>}}
{{UserCmd|command=sudo dirmngr <nowiki></dev/null</nowiki>}}


Cookies help us deliver our services. By using our services, you agree to our use of cookies.