I'm on 12.04LTS.
I had an old OS disk mounted at /media/backup/, and I was converting it to use as a backup disk. I accidentally ran sudo rm -rf /var/ rather than sudo rm -rf var/, and deleted some of my /var/ before catching my mistake with ^C.
I recopied across some files from /media/backup/var/ using cp -na /media/backup/var/specific_path/* /var/specific_path/, mainly doing the obvious here (folders in /var/ which had fewer files than in /media/backup/var/ for example). A few things were obviously not working:
- Totem complained from the command line that it was unable to connect to jack (this is important as the machine is a HTPC running mythtv)
- some programs complained that there is no
/var/lib/dbus/machine_id, and this folder and file was not recreated on reboot (I had expected it might be)
Once I felt I had done enough, I tried a reboot.
The tty7 fails, and I get a text-based login. Do I need to copy across some gdm files? My old installation had been gradually upgraded to 12.04LTS from 8.04LTS originally. I'm guessing its var/ has some legacy folders that I don't need to reproduce in my /var/. For example it has a var/lib/gdm/ folder, but /var/lib/ doesn't. Then again I thought gdm had been deprecated?
Can I do a 'repair' using an installation CD, or is there a way to use my backup to repair the rest?
UPDATE
cp /media/backup/var/lib/gdm/* /var/lib/gdm/ got me to the point where I can boot to the desktop. I'm now in a less critical state, but my question above still stands: is there a way to detect what should be missing, or force some sort of intelligent dpkg-reconfigure for just those packages with missing files?

