Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PANIC! I deleted /var/db/pkg
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
cubancigar11
Guru
Guru


Joined: 10 Jan 2005
Posts: 330

PostPosted: Thu Feb 21, 2008 3:36 pm    Post subject: PANIC! I deleted /var/db/pkg Reply with quote

What to do now :( Google doesnt help... nothing to be found from forum search. I know this has been asked before and one can do something... help please!!!!
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Thu Feb 21, 2008 3:42 pm    Post subject: Reply with quote

Umm, you're basically screwed, unless you backed it up. You'll have to emerge world to restore it. If the world file is intact, as it should be, then it should be fixable. Just pretend you changed your CFLAGS or something and you need a full rebuild to achieve maximum rice.
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2447
Location: Germany

PostPosted: Thu Feb 21, 2008 3:44 pm    Post subject: Reply with quote

/var/lib/portage/world should still contain your worldfile then. Unless portage throws some kind of error, you can just emerge -e system; emerge -e world; to reinstall everything. It will take time to compile everything of course but it will create a new /var/db/pkg for you in the process. It will not, however, get you rid of old packages and files that don't get overwritten by the emerge process (for example if you installed some packages with --oneshot or kept some obsolete dependencies around instead of doing a --depclean). You will have to delete them (semi-)manually.
Back to top
View user's profile Send private message
cubancigar11
Guru
Guru


Joined: 10 Jan 2005
Posts: 330

PostPosted: Thu Feb 21, 2008 3:56 pm    Post subject: Reply with quote

Any comment on this?
http://forums.gentoo.org/viewtopic-t-513191-start-0-postdays-0-postorder-asc-highlight-.html

Right now I am running this script.

Any idea on undeleting files? (http://www.noah.org/wiki/Undelete)

My harddisk in a USB disk... any help?
Back to top
View user's profile Send private message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Thu Feb 21, 2008 4:02 pm    Post subject: Reply with quote

To be honest: I think the easiest way is to save /etc and /home and re-install gentoo from sratch.
_________________
Never argue with an idiot. He brings you down to his level, then beats you with experience.

How-To: Daten verschlüsselt auf DVD speichern.
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Thu Feb 21, 2008 4:06 pm    Post subject: Reply with quote

I don't think that script will work. It may reconstruct some parts, but the all important CONTENTS will not be there. Without that portage doesn't know what files belong to what package, and you may have very different CONTENTS for the same version of a package depending on the USE flags you've set. To get that back, you have to do an "emerge -e system && emerge -e world" anyway. As to undelete, well you can try, but since you're running a script that's writing stuff into the directory you want to undelete, all I can say is good luck. The last thing you want to do before attempting to undelete is start writing changes to disk.

[edit] Which, I see, is the first thing that page tells you.
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
cubancigar11
Guru
Guru


Joined: 10 Jan 2005
Posts: 330

PostPosted: Thu Feb 21, 2008 4:07 pm    Post subject: Reply with quote

You are a masochist! :oops:


So am I. Burn my processor... :twisted:
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2447
Location: Germany

PostPosted: Thu Feb 21, 2008 4:44 pm    Post subject: Reply with quote

It's not possible to regenerate the list of file(s) and timestamp that were installed for each package by portage.

From the portage logfile it is possible to regenerate the worldfile under circumstances (the log needs to be complete and the parser must be able to cope with cancelled / failed emerges) which in turn allows you to reemerge the packages you had installed in the first place. However you still have your worldfile so you can just skip that step. If you lost your world file as well I'd have recommended a clean reinstall instead, keeping only your config files.
Back to top
View user's profile Send private message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Thu Feb 21, 2008 5:01 pm    Post subject: Reply with quote

The world file of course can be used to simplify a new install.
_________________
Never argue with an idiot. He brings you down to his level, then beats you with experience.

How-To: Daten verschlüsselt auf DVD speichern.
Back to top
View user's profile Send private message
cubancigar11
Guru
Guru


Joined: 10 Jan 2005
Posts: 330

PostPosted: Thu Feb 21, 2008 6:50 pm    Post subject: Reply with quote

Now it doesn't matter. I have rolled out stage3.

Man, last time I installed gentoo, it was 2006.

Btw, what is the problem with stage1? My bootstrap.sh stopped in middle complaining that gcc cannot create output files. "su" was not working, "which" was not working. coreutils failed in the middle.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2447
Location: Germany

PostPosted: Thu Feb 21, 2008 10:46 pm    Post subject: Reply with quote

There is no problem with stage1; it's just that it's not required for the supported architectures. Making a stage3 install is easier and gives you the same result as a stage1 install if you re-emerge toolchain and system with your cflags.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum