Posted May 29, 2017
leon30: So today I updated my linux mint like always and something happened during the update - during the update of *upnpc some file was locked and can't continue, it wanted me to run "sudo apt-get --configure -a" which was totally impossible because the console didn't start, nor the start menu, nor anything in the task panel or at the desktop :( After restart even the grub didn't load and send me straight to my windows on my other hard drive. Any thoughts how I can fix that, or I should reinstall and never ever update it again :(
It's a bit technical, but what I'd do in your situation is boot off the install CD and then open a terminal and chroot into the hard drive's install. Then, anything run inside the terminal will act as if it was booted off the hard drive and you can run your fix-ups. Gentoo Linux has good guides [url=https://wiki.gentoo.org/wiki/Project:X86/Chroot_Guide][2], so here are the relevant bits adapted for you:
1. Boot off your installation CD into the desktop
2. Choose/make a folder to mount your hard drive at, if the CD hasn't already. (something like /mnt/chroot)
3. Mount your hard drive to the folder you created (something like "sudo mount /dev/sda1 /mnt/chroot" where the /dev/sda1 part can be identified in the partitioning utility in the system utilities section of the launcher menu.)
4. Open up a terminal
5. Run these commands to give the chroot access to the various kernel interfaces that normally get set up for it on boot:
sudo mount --rbind /dev /mnt/chroot/dev
sudo mount -t proc /proc /mnt/chroot/proc
sudo mount --rbind /sys /mnt/chroot/sys
sudo cp /etc/resolv.conf /mnt/chroot/etc
6. Run these commands to switch into the chroot
sudo chroot /mnt/chroot /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
(The last one just changes the prompt so you can easily see whether the terminal is in the chroot)
7. Use the chrooted terminal to run whatever commands you need to in order to fix up your hard drive-installed copy.
Since you're on MINT, which descends from Debian, once you've got everything else fixed up, you should be able to fix GRUB by running "sudo update-grub" in the chrooted terminal.
NOTE: If you want to run GUI apps in the chroot, you'll need to copy the ~/.Xauthority and ~/.xauth* files from the CD desktop's $HOME to the chroot's $HOME and then run "export DISPLAY=:0.0" or the chrooted apps will get an "access denied" when they try to connect to the GUI server.
Worst case scenario, one trick I've used in the past to recover a totally messed up system was:
1. Boot off the install CD into the desktop
2. Delete every folder on the hard drive except "/home".
3. Rename "/home" to "/home.old"
4. (optional, but recommended) Stick in a thumbdrive and copy "/home.old" to it as a backup
5. Start the install process, choose advanced partitioning, and, rather than changing anything, just set the mount points and make sure "format" is unchecked.
6. When it asks for a username, enter your old one.
7. When the installation finishes, before you restart, replace /home/your_username on the hard drive with /home.old/your_username
8. Reboot and reinstall any non-default packages you had before.
(If you want to get advanced, it's possible to chroot into the hard drive and dump a list of installed packages which can then be restored automatically [url=https://askubuntu.com/questions/9135/how-to-backup-settings-and-list-of-installed-packages][2] after the reinstall is finished.)
Yes, both of these could be considered somewhat "nuclear options" by some people, but they apply generally... and I prefer to know one solution that I can use everywhere, rather than a handful of things I learn once and then never use again.
Post edited May 29, 2017 by ssokolow