Linux run install as root

Linux Mint Forums

Forum rules
There are no such things as «stupid» questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

Installing a program as root

Post by flaugher » Mon Jan 02, 2017 4:32 pm

I am not a COMPLETE noob, since I’ve installed Mint on several machines, but this one is a problem.

New NVIDIA driver updates NVIDIA-Linux-x86_64-304.134.run keep telling me that they must be installed as «root». I’ve searched the web and forums and all I can find is people telling me NEVER to run, or install anything, as root. Apparently it’s just not supposed to be done, and no one will SAY how to do it because it’s too dangerous.

I tried myself to go to the Login Window Preferences and under Options selected «Allow Root Login», but that doesn’t seem to do a thing.

So, how does one install new driver updates?

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

Re: Installing a program as root

Post by MintBean » Mon Jan 02, 2017 4:35 pm

Re: Installing a program as root

Post by flaugher » Mon Jan 02, 2017 4:46 pm

The only driver that appears there is .132 which is 2D. I downloaded .134 from NVIDIA for 3D graphics in order to run X-Plane 10.

The installation worked fine on a computer I built from a motherboard with a GTX-650 graphics card, but now I’m trying to install on an older HP Pavilion laptop with the NVIDIA C67 card. When I run the program, it hangs trying to initialize OpenGL. It may just be the card.

jimallyn Level 19
Posts: 9075 Joined: Thu Jun 05, 2014 7:34 pm Location: Wenatchee, WA USA

Re: Installing a program as root

Post by jimallyn » Mon Jan 02, 2017 5:18 pm

I agree with MintBean, the best way to install drivers is with Mint’s Driver Manager. If you want the newest version, you may have to install from Nvidia’s latest release. Try this: open a terminal, navigate to wherever you have saved the driver file, then enter sudo NVIDIA-Linux-x86_64-304.134.run . That will ask for your password, then will run the installer as root. Note: it is possible that this could screw up your video and make it impossible to boot into the GUI. I had that happen once, and had to boot to terminal and remove the drivers from there, then reboot. Let’s hope that doesn’t happen, but if it does, people on the forums can almost surely walk you through it.

Читайте также:  Astra linux проверка репозитория

“If the government were coming for your TVs and cars, then you’d be upset. But, as it is, they’re only coming for your sons.” — Daniel Berrigan

Re: Installing a program as root

Post by MintBean » Mon Jan 02, 2017 5:19 pm

The recommended driver is for GeForce7 series cards, which appears to be what you have from a quick Google or am I mistaken? I’ve never heard of this concept of a driver for 2D and a separate driver for 3D — are you sure you have this straight?

If you’re running the Mint Cinnamon edition and it’s not complaining about running in software rendering mode, you’re running in 3D accelerated mode.

Anyway, if you want to have at it, here’s how to run a ‘.run’ The final line tells how to run with sudo (which gives root privileges to the command that follows it.)

Terminal Method

Assume the file is called some-app.run and is in the folder /home/user/Downloads. You will need to modify these instructions to fit your situation.

Open a terminal (Applications->Accessories->Terminal).

enter cd /home/user/Downloads
enter chmod +x some-app.run

if step 4 fails with a message including ‘permission denied’, try entering sudo ./some-app.run (you will need to enter your password for this).

Источник

How to run a .run file as root?

driver run 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. 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.

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?

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.

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.

Читайте также:  Скрытые папки linux ubuntu

@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

4 Answers 4

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.

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.

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

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

Источник

How to run applications as root?

I am having some strange issue with Kate and Kwrite. When I click on Open File, it crashes with segmentation fault. I am a complete newbie to Linux, and I think the issue is that I am not running the application as root. How do I run applications as root in Ubuntu? Is it bad practice to do this? What is the purpose of the whole root thing, where even though we need to use root so frequently, it is not utilized as default?

Читайте также:  Linux zip with hidden files

You can do some very damaging things when using root to open an editor so please do not go that way 😉 2 other solutions that do not require root: try and fix the segmentation fault or use another editor (gedit is gnome’s editor). kate en kwrite are KDE program (so not Gnome).

@АртёмЦарионов For one thing, as root you can edit files your computer uses to start up the operating system or load your graphical environment, effectively breaking your computer.

5 Answers 5

It is pretty simple to run a program as root.

For a console program use

If it is a GUI application use

UNIX-like operating systems (including Linux) use a concept called privilege separation to ensure that the system stays safe. UNIX was designed as a multi-user system from the ground up — that is, it was designed so that many people could use one computer running UNIX at once. Because most users don’t need to be able to modify the core system only the system administrator should have that privilege. That privileged user is traditionally called root. (Root is a lot like Administrator in Windows.)

This makes sense on several levels. Commonly, a web server or other process that exposes a port to other (possibly malicious) computers will run as its own user (Apache runs as the user nobody ), so that even if the web server program is hacked, the attacker can’t trash the entire machine quite so easily. It even makes sense for mostly single-user machines such as desktops: if other members of your family, for example, somehow manage to run rm -rf / (do NOT run that), they won’t have permission to delete every file on the system, like they would if there were no such thing as privilege separation.

There are several commands you can use to elevate your privileges. The sudo command exists to temporarily give you root-level privileges when you need them to administer the system. You can also use the commands gksudo or su . The latter can be used only if you know root’s password and is a good option if your account doesn’t have permission to use sudo .

The root user can do anything on a system, with almost no exceptions. So even if you request something by accident, it will be carried out with little or no warning, even if it’s bad for the health of your system. This is why it’s good practice to do most of your activities as a normal user, and use root only when needed, like when you’re installing a program.

You shouldn’t need to use root to get rid of a segmentation fault. If root is the only thing that fixes a segfault, then the program has a bug. Programs should not fail like that just because they don’t have root.

Источник

Оцените статью
Adblock
detector