Assuming you have not actually changed the root user but removed the first user from the list of administers then this is relatively easy to fix.
Press CTRL+ALT+T and enter
You should see something similar to.
If this shows sudo you should be an administrator. In Ubuntu prior to 12.04 the group was admin If not this is the problem.
First you need to boot to a root shell if you don't normally see grub when you boot hold SHIFT.
You should see something like this:
Select recovery mode, then drop to root shell.
Finally mount the file system read write
mount -o rw,remount /
If the problem was that you were not in the sudo group it can be fixed with
usermod -aG sudo warren
warren with your user name. If you are not sure what the user name should be it was the
uid= field from the
id command you ran earlier.
admin if you are using a version of Ubuntu prior to 12.04.
Another less likely possibility is that you have changed the
If this is the problem then enter
Edit this file to look like this (12.04 default):
# This file MUST be edited with the 'visudo' command as root.
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
# See the man page for details on how to write a sudoers file.
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives: