martes, 28 de febrero de 2012

How to restore Grub after installing a new kernel (or Windows)

To reinstall my working grub, i've read and applied the steps mentioned in this tutorial. It worked like charm!


Using Ubuntu 9.10 livecd or higher
Here assuming the Ubuntu partition is sda7,and /boot partition is sda6 (if you have a separate /boot partition).
Boot up ubuntu from the livecd,open terminal and run:
sudo -i
mount /dev/sda7 /mnt
mount /dev/sda6 /mnt/boot  #skip this one if not have a separate /boot partition
grub-install --root-directory=/mnt/ /dev/sda
If you miss “grub.cfg” file,use following to recreate:
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt update-grub
umount /mnt/sys
umount /mnt/dev
umount /mnt/proc
exit

miércoles, 1 de febrero de 2012

can't set the locale; make sure $LC_* and $LANG are correct problem in Ubuntu 11.10 (32 bits)

I had this problem after installing Ubuntu 11.10 (32 bits). From a terminal, every time I executed some commands (apt-get install, update, man xxx, etc), some locale warnings appeared, like this one

can't set the locale; make sure $LC_* and $LANG are correct

Also this error messages were shown:
Cannot set LC_TYPE to default locale: No such file or directory

I solved the problem by adding in /etc/environment the following line
LC_ALL="en_US.utf8"

and then rebooting the system.

With this line, everything worked just fine. No more errors/warnings at the console!!