To solve an issue when running apt-get upgradefor xen vps
This was a tricky one, but the thing is that your /boot/grub/device.mapprobably contains "(hd0) /dev/sda", while your root fs is at /dev/xvda1(and swap at /dev/xvda2).
To update the kernel, you will need to:
1) Edit /boot/grub/device.map and replace "/dev/sda" with "/dev/xvda".
2) Actually create a /dev/xvda, that probably does not exist. Do it with: "mknod /dev/xvda b 202 0"
3) Fix the "update-grub" script to find the device correctly, which youcan do by editing /usr/sbin/update-grub, locating the function"find_device()" and replacing the "grub-probe" line with somethinglike: "echo /dev/xvda"
4) Now, try "aptitude update" and "aptitude upgrade" again.
If you still have an error, try running "update-grub 0" manually and then "aptitude upgrade" again.
For yardvps, also need to change /dev/xvda to /dev/xvda1 at /boot/grub/menu.lst
If you get the error "Error opening terminal: rxvt-unicode." whentrying to run nano on a remote machine, running this command from themachine on which you have rxvt-unicode installed will resolve theissue:
If you're performing an install via SSH, you can run the above command and then run this:
So that when you chroot you should not have an issue.