If GRUB is already working but you are unable to access Ubuntu, you may be
able to use recovery mode. Press Shift after the BIOS is done to access the
GRUB menu. Select Advanced Options for Ubuntu. From the new menu,
select an entry with the words recovery mode. This boots into a recovery
menu with options to automatically fix several possible problems, or at least it
lets you boot into a minimal recovery-mode version of Ubuntu with only the
most necessary processes loaded. From here, you may be able to fix disks,
check file systems, drop to a root prompt to fix file permissions, and so on. If
you don’t understand the entries in this menu, they aren’t likely to help you
much, and you should consider the next option.
Reinstalling Ubuntu
If you are able to boot using a live DVD or bootable USB drive using the
same Ubuntu release or one just newer than the one on the hard drive, and if
there are no hardware problems with your system, you can usually recover all
your files by reinstalling Ubuntu. Boot from the install medium and select
Install Ubuntu. Make sure you are paying attention. The installer will detect
an existing Ubuntu installation and give you the option to reinstall Ubuntu.
When you do this, it should not overwrite existing files in your /home
directory. Note that we said should not—not will not—and you should
consider this an option of last resort.
Tips and Tricks
This last section is a motley collection of useful command-line tidbits that
don’t really fit well in the other categories but that are worth sharing. Enjoy.
Running the Previous Command
You can rerun the previous command with the up arrow and Enter. You can
also rerun it with !! (referred to as “bang bang”). This is especially useful for
times when you typed a command correctly but forgot to preface it with
sudo, as shown here:
Click here to view code image
matthew@seymour:~$ apt-get update
E: Could not open lock file /var/lib/apt/lists/lock - open (13:
Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission