You are not logged in.
A few minutes ago I installed pacman-cage from the archlinuxfr repo and tried it out. It didn't work and first, and i found out I needed to enable the loop module, so I modprobed it and added it to my MODULES in rc.conf. So I run sudo pacman-cage again, and it seems to work fine, but then when I decide to go look at my local database, it's empty. /var/lib/pacman/local is empty. I was slightly annoyed, but quite sure I saw pacman-cage make a backup, so I checked the place it put the backup, /mnt, but there is nothing there. So I checked /tmp, also not there. Then I did sudo updatedb and locate pacman | grep local.... it's completely gone. I think pacman-cage needs more warnings on it. ![]()
Anyways, now I've got no local database on a very customized system that I don't want to have to redo. If anyone could point me in the right direction on repairing my pacman database, I'd be extremely grateful. If it's not possible to repair... well, that's life. ![]()
EDIT: Oh, also, I have no backups at all of this system. >_<
Last edited by sco50000 (2008-06-28 08:35:02)
Offline
Pacman-cage made a backup somewhere on /var/lib directory. I think it's called pacman.bak or something. I had an exactly the same problem too, but I have made a backup of /var/lib/pacman before.
If you look into the pacman-cage code, you can pretty much do it manually, if you prefer.
Where's my sig?
Offline
I'm sure there is a pacman-uncage script that comes with it...
Offline
pacman-uncage will only work if pacman-cage worked correctly. In this case it screwed up =/
[home page] -- [code / configs]
"Once you go Arch, you must remain there for life or else Allan will track you down and break you."
-- Bregol
Offline
prasetyams: I've checked the pacman.bak, and it's local directory is empty too. Anything else should have been found by the locate pacman | grep local.
Offline
I always wondered why people embark on journeys with hacks like pacman-cage.
I think you could use a script named pacfix, if you are 100% sure you lost your database
Offline
carlocci: Thanks, I have a list of the packages I have installed now, but I'm wondering how I am supposed to fix my pacman db. Do I have to reinstall all the packages on the list? That would take quite a bit of downloading. ![]()
Offline
have you ever emptied your cache? if not you don't really need to download anything.
also I believe pacfix just reads a .log file, so that won't read the stuff that was put on your system at install-time
[home page] -- [code / configs]
"Once you go Arch, you must remain there for life or else Allan will track you down and break you."
-- Bregol
Offline
My cache is empty, and I've had this system for a few months, so I'm not sure if all the packages from install time have been updated. I still have the disc I installed with, and i know that I installed all the packages on it. (it's a Don't Panic base install disc I believe)
Offline
see? this is EXACTLY the reason why I keep my cache, because of times like these. Did you really need the extra space cleared up?
[home page] -- [code / configs]
"Once you go Arch, you must remain there for life or else Allan will track you down and break you."
-- Bregol
Offline
Well, I'll be sure to keep my cache and backup /var/lib/pacman in the future, but I can't change what already happened. ![]()
So any other ideas besides getting the list of what's on my installer disk and re-downloading? Is it possible that I could just get the /var/lib/pacman/local stuff for the packages?
Offline
Actually, since we now have the file list in every repo you could easily write a script to simply copy the files from the sync database and the file archive.
tl;dr You should install base again and then reinstall all the packages
edit: removed a stupid thing about %BACKUP%
Last edited by carlocci (2008-06-29 13:16:06)
Offline
carlocci: Where is the sync database and the stuff I need to put in my /var/lib/pacman/local directory? And do you mean I should reinstall base by downloading the packages, eg pacman -S base?
Offline
carlocci: Where is the sync database and the stuff I need to put in my /var/lib/pacman/local directory? And do you mean I should reinstall base by downloading the packages, eg pacman -S base?
I'm sorry: editing made the post quite confusing.
The "easy" way
I suggest you to reinstall all the packets pacfix showed you.
Of course it should be a smart reinstall in order to preserve the "installed as dependency flag" as much as possible.
You should consider that packets installed by pacman during the installation aren't logged in the pacman.log which is the source from which pacfix extracts the packages you have.
For these reasons I would reinstall the base group first and then all the packages like it was a real installation letting pacman solving the dependencies and checking the pacfix list to see if I forgot to install something, so pacman -S xorg, pacman -S kdemod, pacman -S amarok and so on.
After I installed all the packages I would print a list of the packages in the database and check the pacfix list and install the missing ones.
This is better than blindly feeding pacman with the packets showed by pacfix and I don't think it would be that time consuming.
Remember to be smart in your reinstallation: you could use pacman --root /temporary -S packet
this way you don't have to overwrite your installation preserving configuration files. (You should do this as long as your system is up to date, though)
The other way
When you sync the database you actually download part of the metadata you need, ie the DESC and DEPENDS files.
In the installed packages database there are usually 3(5) files: DESC, DEPENDS, FILES + INSTALL, LICENSE(?)
You have DESC and DEPENDS, you need FILES.
For a while we've been having another archive in the repositories which contains FILES (which is the filelist the package will install) for every package. (it's used by scripts which tell you what packages to install in order to have a particular file on your system).
You could write a script which mixes these pieces of information and restores your pacman database.
A couple of warnings:
1) you would miss .pacnew files for the next installation (as FILES would have no %BACKUP% part), that is pacman would overwrite your configuration files. This would happen even with the easyway if you brutally decide to force the reinstallation for every package though, so I suggest you to back up your etc directory completely.
2) I don't really know INSTALL files and you might get in trouble if INSTALL files contain some actions which pacman performs when uninstalling/upgrading packages
Offline
carlocci: Thanks a LOT!
I did it the "easy way" and it's all working quite well now. I've backed up /etc and I plan on never emptying my cache again.
Offline