How should I recreate /var/lib/dpkg/info/* ?

Halvor Raknes

Member
Joined
Apr 19, 2021
Messages
151
Reaction score
15
Credits
1,197
I accidentally deleted /var/lib/dpkg/info/* on Linux Mint 22.1 (Ubuntu 24.04). I have since run apt --fix-broken install, and sudo apt check now reports no problems. However, dpkg --audit reports that almost all installed packages are "missing the list control file in the database, they need to be reinstalled". There are about 2863 installed packages but only 77 .list files remain in /var/lib/dpkg/info. What is the recommended way to regenerate the missing .list files? Is apt reinstall $(dpkg-query ...) the right approach, or is there a better/safer method?
 


Do you have Timeshift snapshots ?

If you do, simply Restore to a snapshot taken prior to the /var/lib/dpkg/info/* deletion
 
What happens when you run an "apt update" on the system, I would think that would re-populate itself as it's only info of package information?
 
What happens when you run an "apt update" on the system, I would think that would re-populate itself as it's only info of package information?
I haven't tried that yet. I've been going up until now with the help from LLMs. First DeepSeek got me into this trouble, now I've been getting help from ChatGPT. It actually recommended I get som advice from real people on this part of the repair rather than simply following its advice…
 
I haven't tried that yet. I've been going up until now with the help from LLMs. First DeepSeek got me into this trouble, now I've been getting help from ChatGPT. It actually recommended I get som advice from real people on this part of the repair rather than simply following its advice…
Can you try running "apt update" and "apt upgrade" from the command-line and see if those run correctly without errors?
 


Follow Linux.org

Members online


Top