Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
By mistake removed /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
vitaly-zdanevich
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2019
Posts: 106
Location: Belarus

PostPosted: Tue Sep 03, 2024 9:46 pm    Post subject: By mistake removed /var/db/pkg/ Reply with quote

Hi, what to do in such case? Thanks for the help.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22619

PostPosted: Tue Sep 03, 2024 9:58 pm    Post subject: Reply with quote

Restore it from the most recent backup. Next, check /var/log/emerge.log to see what, if anything, you have changed more recently than that most recent backup. You will need to do some manual repairs to update the restored copy to reflect changes that happened since it was created. We can provide more guidance on that once we know what you have done since the backup.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9823
Location: almost Mile High in the USA

PostPosted: Tue Sep 03, 2024 10:15 pm    Post subject: Reply with quote

If you have no backup, reinstall is probably the only realistic way to regenerate it.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
vitaly-zdanevich
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2019
Posts: 106
Location: Belarus

PostPosted: Tue Sep 03, 2024 11:31 pm    Post subject: Reply with quote

I tried
Code:
emerge -e @world

but faced with circular dependency, so for now I copied /var/db/pkg/ from my another Gentoo and run
Code:
emerge -e @world

What do you think? As I understand - after emerging - I need somehow to remove folder that are not in @world?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5094
Location: Bavaria

PostPosted: Wed Sep 04, 2024 12:02 am    Post subject: Reply with quote

vitaly-zdanevich wrote:
[...] so for now I copied /var/db/pkg/ from my another Gentoo and run
Code:
emerge -e @world

In this folder you have all ebuilds for every package ... just do a "emerge --sync" to get the current state. There is no need to recompile your whole system (emerge -e).
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22619

PostPosted: Wed Sep 04, 2024 12:11 am    Post subject: Reply with quote

vitaly-zdanevich wrote:
I tried
Code:
emerge -e @world
but faced with circular dependency, so for now I copied /var/db/pkg/ from my another Gentoo and run
Code:
emerge -e @world
What do you think? As I understand - after emerging - I need somehow to remove folder that are not in @world?
Yes, you get a circular dependency because without the original VDB, Portage considers you to have no packages installed, so any loops that are normally avoided now apply to you. You could try to trick the dependency resolver by applying package.provided to claim the existence of things you know are installed, but I strongly suggest you follow my original suggestion: restore VDB from backup. Even if it is not exactly current, it will get you much closer.

Yes, if you pursue the --emptytree route, then when it finishes, you should remove from the system all orphaned files and folders.
pietinger wrote:
vitaly-zdanevich wrote:
[...] so for now I copied /var/db/pkg/ from my another Gentoo and run
Code:
emerge -e @world

In this folder you have all ebuilds for every package ... just do a "emerge --sync" to get the current state. There is no need to recompile your whole system (emerge -e).
emerge --sync would bring the Portage tree up to date, and is easy since everyone has a shared copy of that. OP deleted /var/db/pkg, which is unique to each system. No one else has exactly the VDB that OP lost.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5094
Location: Bavaria

PostPosted: Wed Sep 04, 2024 12:21 am    Post subject: Reply with quote

Hu wrote:
[...] OP deleted /var/db/pkg, which is unique to each system. No one else has exactly the VDB that OP lost.

Oh my goodness, I mixed it up with /var/db/repos/ ... :oops: ... thanks a lot for the objection, Hu.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9823
Location: almost Mile High in the USA

PostPosted: Wed Sep 04, 2024 12:39 am    Post subject: Reply with quote

The worry is that even if you do an emptytree rebuild there will be lots of dangling files left around that are no longer tracked (which was why /var/db/pkg is used for in the first place) especially if you weren't clean and up to date with fresh packages at the time of wipe (and using the same repo snapshot as when you last updated @world ... )

so expect a lot of hassle (like *every* config file probably would end up assumed modified) and orphans. I suppose it's still better than no longer being able to update @world ...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
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