How to run a .run file as root?

I downloaded a .run file for a Nvidia driver, but when I run it in the terminal it tells me it must be run as root.

I'm a complete noob and I barely even know what root is. I think it's somewhere around the equivalent of admin in windows. driver run as root

Well, I got the file to run but it turns out that the driver will not recognize my card. I've heard about other problems with Nvidia cards not working right with 64 bit versions of 12.04.


You need to do two things; both from a Terminal prompt:

  1. Change to the directory where you have the .run file stored.
  2. Type: chmod 755 filename.run
  3. Type: sudo ./filename.run

The above commands will make the file executable and will launch the executable with root-level permissions.


Add the command "sudo" before the command. For example: sudo blah.sh

After you enter your password the command will run as root. Be careful to verify the trustworthiness of a package or command before running it with sudo.


root is the master account in Ubuntu; every account has limited privileges but the root account has no limitations. The reason for hiding root is that in most cases you don't need root access. The analog in Windows would be having to authenticate when you want to install a driver; in Ubuntu you have to be root or have root privileges.

There are two ways for you to get access as root. You can type:

sudo <whatever-command> and Ubuntu will ask you for your password and then execute that command as root.

OR

sudo su, where you'll input your own password and then you will become root (i.e. you will be logged in as root).

I prefer the latter because it gives me more control; sometimes running a command just as root isn't enough, but doing it this way can be more dangerous (i.e. you could accidentally cause more damage).

I recommend trying the first way. And then trying the second way if that doesn't work. Just make sure you get out of root after you're done (i.e. type exit after you're finished doing what you need to do as root).