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.

  • 3
    If you are, as you say, a complete noob, perhaps there is a better and easier way to do what you're doing. Are you simply trying to install the Nvidia driver? There is a point and click interface for that - look for "Additional drivers" under your system settings. If you have already tried that, could you let us know, and what went wrong? May 31 '12 at 6:10
  • 1
    In case your are not so experienced with Ubuntu I would go a step further and like to discourage you from installing graphic drivers other than through the methods mentioned above.
    – Takkat
    May 31 '12 at 9:44
  • Also if you want to test a beta driver, look at this askubuntu.com/questions/131150/…
    – desgua
    May 31 '12 at 11:14
  • 1
    There are no drivers under the "additional drivers" setting. I don't need to be discouraged, how else will I learn but through trial and error? Beta driver? I will look into that. I have plenty of time to re-install ubuntu thousands of times. May 31 '12 at 19:47
  • @neon_overload, I know this is an old thread, but I would just like to point out that I had to install "Additional drivers" from the Ubuntu Software Center, as it didn't show up by default
    – Sos
    Apr 10 '13 at 17:55

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.

  • But the file ran OK, obviously, so why confuse him with unnecessary steps? Also, you should specify that "filename" is not to be typed literally, but substitutes for the name of the .run file. May 31 '12 at 4:19
  • It's alright, I understood it. I had to google some things but in the end it was fine. May 31 '12 at 5:04

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.

  • PS you really should read help.ubuntu.com/community/RootSudo
    – notkevin
    May 31 '12 at 4:01
  • 1
    Of course, if the command is ./blah.sh then to run it as root you would do sudo ./blah.sh, rather than sudo blah.sh (which would only run blah.sh if it's in the $PATH). May 31 '12 at 7:38
  • Attention, must possibly use gksudo for graphicals... Nov 26 '13 at 21:01

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.


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).

  • 1
    sudo -s is widely considered preferable to sudo su (though this may have more to do with elegance than anything else). To get a root shell that behaves like an actual root login, use sudo -i instead. (This is similar to sudo su -.) Also, logout will not work to get out of a sudo su shell, because such a shell is not a login shell. You need to use exit instead. May 31 '12 at 7:36
  • @EliahKagan Cool! I didn't know about sudo -i/-s. Good point on exit, I mistyped that. I'll edit the entry above. Can you explain why sudo -s is more "elegant"?
    – Avery Chan
    May 31 '12 at 22:56
  • 1
    Sure, but first some background so that the explanation can be beneficial to others. su and sudo are two separate mechanisms for running a command as a some user, who may be different from the user invoking them. (If not otherwise specified, su and sudo will run--or attempt to run--the command as root.) Since su authenticates with the target user's password, and password authentication for root is turned off by default (and not recommended or officially supported) in Ubuntu, you cannot use su to become root, but root can certainly use su to become some other user. May 31 '12 at 23:15
  • 1
    sudo and su are both capable of running a single command. sudo does this by default and su does this when given the -c flag. They are also both capable of starting a shell. sudo does this when given the -s flag (or -i to simulate an initial login shell), and su does this by default (or when given the - flag, to simulate such a login shell). When you run sudo su, you are becoming root with sudo, and then becoming root again as root (i.e., root su-ing to itself), to start a shell. It's more elegant to just "change" identity once and start the login shell... May 31 '12 at 23:20
  • 1
    ...which is what sudo -s (or sudo -i) accomplishes. su -c 'sudo ...' (with ... replaced by a command) would be similarly inelegant. Commands like sudo bash are considered a bit inelegant for a different, related reason--sudo has the -s and -i flags to start a shell however you like, so one may as well use them. While these ways are inelegant (and subtly different in their effects from the suggested sudo -s and sudo -i), they are not actually bad and they work fine, so it's OK to go on using them if you wish. May 31 '12 at 23:23

If you have enabled the root account you can use


Enter the password for root, cd to your application folder, then run

  • 1
    In Ubuntu root isn't setup for login / su with password as default, so the above wont work out of the box.
    – Soren A
    Feb 22 '17 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.