Skip to content

Instantly share code, notes, and snippets.

@qub1750ul
Last active July 2, 2018 15:52
Show Gist options
  • Save qub1750ul/dfc33d5bcd61a1fa24e3b02e09811716 to your computer and use it in GitHub Desktop.
Save qub1750ul/dfc33d5bcd61a1fa24e3b02e09811716 to your computer and use it in GitHub Desktop.
How to solve "duplicated database entries" with pacman
  • Ensure that no .pacnew files exists in the system
  • Get the list of duplicated package entries, store it in a file named duplicateNames.txt
  • Execute this script as root
extraEntries="`\
	for name in $( cat duplicateNames.txt ) ; do
		ls $localDb | grep $name | sort | sed 1d
	done
`"

cd /var/lib/pacman/local
rm -rf $extraEntries
  • Perform a full system upgrade, expect some errors
  • Deal with eventual .pacnew and .pacsave files
  • Perform another full system upgrade to ensure everything is fine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment