View previous topic :: View next topic |
Author |
Message |
vitaly-zdanevich Tux's lil' helper
Joined: 01 Dec 2019 Posts: 106 Location: Belarus
|
Posted: Tue Sep 03, 2024 9:46 pm Post subject: By mistake removed /var/db/pkg/ |
|
|
Hi, what to do in such case? Thanks for the help. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22648
|
Posted: Tue Sep 03, 2024 9:58 pm Post subject: |
|
|
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 |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9824 Location: almost Mile High in the USA
|
Posted: Tue Sep 03, 2024 10:15 pm Post subject: |
|
|
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 |
|
|
vitaly-zdanevich Tux's lil' helper
Joined: 01 Dec 2019 Posts: 106 Location: Belarus
|
Posted: Tue Sep 03, 2024 11:31 pm Post subject: |
|
|
I tried
but faced with circular dependency, so for now I copied /var/db/pkg/ from my another Gentoo and run
What do you think? As I understand - after emerging - I need somehow to remove folder that are not in @world? |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5104 Location: Bavaria
|
Posted: Wed Sep 04, 2024 12:02 am Post subject: |
|
|
vitaly-zdanevich wrote: | [...] so for now I copied /var/db/pkg/ from my another Gentoo and run
|
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 |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22648
|
Posted: Wed Sep 04, 2024 12:11 am Post subject: |
|
|
vitaly-zdanevich wrote: | I triedbut faced with circular dependency, so for now I copied /var/db/pkg/ from my another Gentoo and runWhat 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
|
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 |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5104 Location: Bavaria
|
Posted: Wed Sep 04, 2024 12:21 am Post subject: |
|
|
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/ ... ... thanks a lot for the objection, Hu. _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9824 Location: almost Mile High in the USA
|
Posted: Wed Sep 04, 2024 12:39 am Post subject: |
|
|
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 |
|
|
|