You are not logged in.

#1 2016-07-11 02:19:48

LeftyAce
Member
Registered: 2012-08-18
Posts: 159

Pacman duplicated database entry after restored from backup

Hi all,

Firstly, my apologies if this is the wrong forum.

I recently started having kernel panics on boot (complaining about a corrupt or missing init). My /boot partition is on an external drive, and I thought maybe I had forgotten to mount it when I ran pacman -Syu, so I booted the install media and attempted to install linux and linux-headers again. This failed, so I ended up restoring my system from a backup. I'm using rdiff-backup to back up "/" to an external drive. I exclude /home and back it up separately.

I restored from my backup using "cp -ar," and the system boots again! But now if I try to run pacman I get a bunch of errors:

 myPacman -Syu
/boot is mounted. Proceeding...
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: Starting full system upgrade...
error: duplicated database entry 'libcmis'
error: duplicated database entry 'libedit'
error: duplicated database entry 'systemd'
error: duplicated database entry 's-nail'
error: duplicated database entry 'libinput'
error: duplicated database entry 'libgpg-error'
error: duplicated database entry 'iw'
error: duplicated database entry 'python-setuptools'
error: duplicated database entry 'libmwaw'
error: duplicated database entry 'binutils'
error: duplicated database entry 'nano'
error: duplicated database entry 'python-pyparsing'
error: duplicated database entry 'gnutls'
error: duplicated database entry 'python'
error: duplicated database entry 'expat'
error: duplicated database entry 'python2'
error: duplicated database entry 'gmp'
error: duplicated database entry 'libffi'
error: duplicated database entry 'perl-xml-libxml'
error: duplicated database entry 'linux'
error: duplicated database entry 'freetype2'
error: duplicated database entry 'bash'
error: duplicated database entry 'libsndfile'
error: duplicated database entry 'libarchive'
error: duplicated database entry 'libpulse'
error: duplicated database entry 'device-mapper'
error: duplicated database entry 'lvm2'
error: duplicated database entry 'v4l-utils'
error: duplicated database entry 'systemd-sysvcompat'
error: duplicated database entry 'xf86-video-intel'
error: duplicated database entry 'libsystemd'
error: duplicated database entry 'mkinitcpio'
error: duplicated database entry 'libmnl'
error: duplicated database entry 'firefox'
error: duplicated database entry 'python-six'
error: duplicated database entry 'jsoncpp'
error: duplicated database entry 'mpd'
error: duplicated database entry 'feh'
error: duplicated database entry 'fuse'
error: duplicated database entry 'pacman-mirrorlist'
error: duplicated database entry 'netctl'
error: duplicated database entry 'nss'
error: duplicated database entry 'e2fsprogs'
error: duplicated database entry 'ca-certificates-mozilla'
resolving dependencies...
looking for conflicting packages...

If I ignore the errors and continue with installation I get hundreds of "exists in filesystem" errors and then

Errors occurred, no packages were upgraded.

I think this is all caused by me running pacman updates and then rolling my whole system back to a recent backup. Can anyone suggest how to fix this?

Thanks in advance!

Offline

#2 2016-07-11 04:43:35

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Pacman duplicated database entry after restored from backup

But you didn't restore from a backup.
You merged a backup with the current system.

For example, pacman's installed database is in /var/lib/pacman/local/
Each installed package records its data in a folder called "${pkgname}-$[pkgver}-${pkgrel}" -- so if you have upgraded since the backup, you now have a second folder called "${pkgname}-$[oldpkgver}-${pkgrel}" and pacman wants to know why you have two versions of the same package installed simultaneously!


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2016-07-11 12:19:44

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: Pacman duplicated database entry after restored from backup

What is that myPacman alias? Otherwise, Eschwartz nailed it.


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#4 2016-07-11 13:30:13

LeftyAce
Member
Registered: 2012-08-18
Posts: 159

Re: Pacman duplicated database entry after restored from backup

Ah, ok. You are right, I "restored" by copying everything, so both old and new versions of the packages were kept. I think I should have used rsync --delete to avoid this problem, right?

The myPacman alias just checks to make sure /boot is mounted before proceeding, and then passes all command line input to pacman (to avoid the original problem that caused this mess).

I fixed the problem by manually removing the old versions of each package from /var/lib/pacman/local. Is there a better way to fix this problem?

Thanks,

Lefty

Offline

#5 2016-07-11 13:42:03

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: Pacman duplicated database entry after restored from backup

Well, your cp command will have copied the old versions of the files in those packages as well as just the pacman db entries, right? So the "old" db entries were probably more accurate than the "new" ones after that. I would have removed the "new" entries, then re-run pacman -Syu, forcing the installation of individual packages where necessary. You can just reinstall the affected packages now and hope that there are no orphaned files left over, or restore the old database files again, remove the new ones and do as I suggested above, or try your rsync --delete restore.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB