You are not logged in.

#1 2009-10-21 14:58:53

b9anders
Member
Registered: 2007-11-07
Posts: 691

lost the pacman database

I may have accidentally deleted some files I shouldn't have and now I am faced wit the problem that pacman no longer recognises any packages as being installed.

Is there a way for me to regenerate the database somehow? pacman -Syu simply says it is up to date, but any pacman query returns no packages as installed.

Offline

#2 2009-10-21 15:14:49

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: lost the pacman database

What do you have left? Is the cache still there, or a list of installed applications?

I had a similar situation after formatting /var (just posted it under "dumbest computing error"). My solution involved a lot of pacman --force.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#3 2009-10-21 15:19:51

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: lost the pacman database

I am sure I have seen scripts to help you on these forums...

Otherwise:
1) pacman -Sf base
2) use the script on the pacman wiki page to locate files unknown to pacman
3) use "pkgfile" from the pkgtools package to figure out what package should own these files and pacman -Sf those packages

The only problem with this is that you loose dependency information (i.e. you no longer know if a package was only installed as a dep for another package).  You can avoid that by carefully selecting which packages to install.

Offline

#4 2009-10-21 15:20:49

b9anders
Member
Registered: 2007-11-07
Posts: 691

Re: lost the pacman database

disk space is precious on my laptop, so I regularly empty the cache with pacman -Scc.

As far as I can see, the only thing not working is that pacman doesn't have a list of installed applications anymore.

Offline

#5 2009-10-21 15:32:33

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,329

Re: lost the pacman database

If you haven't deleted /var/log/pacman.log, then there's a script somewhere on the forums that parses it and outputs the list of packages that were currently installed.

Offline

#6 2009-10-22 09:53:18

b9anders
Member
Registered: 2007-11-07
Posts: 691

Re: lost the pacman database

I managed to find a wiki page to help me out (strangely enough, I don't recall ever installing qtcurve but it was included):
http://wiki.archlinux.org/index.php/How_To_Restore_Pacman's_Local_Database

but I am wondering if it might be somehow possible to find a list of the locally installed packages I've built from aur. There are quite a few there and I am not altogether keen on them floating anonymously in my system.

Last edited by b9anders (2009-10-22 09:53:47)

Offline

Board footer

Powered by FluxBB