View Full Version : Installing help asap

11th November 2010, 08:33 PM
So i have an install script.I have tried everything.I run it from double clicking it and run it in terminal/run.I had already did the su- thing and i was as root in terminal.althought it keep teling me that needs root priviledges.im pretty new and i just don't get the thing with su- and how to run progs as a root.i can install yums but not scripts.any help?:(

11th November 2010, 09:01 PM
What's the script you're trying to run?

Maybe you could change the title of your post. It's not too descriptive IMHO.

11th November 2010, 09:08 PM
could you provide more detail on this script.

I had already did the su- thing that's su - there's a space between su and -

11th November 2010, 09:08 PM
It's not "su-", it's either "su" or "su -" (with a space between su and the hyphen).

11th November 2010, 09:52 PM
One issue you might be experiencing is that "su -" will change the current directory to root's home directory, which is not where you were before. So after "su -" you either need to "cd" (change current directory) back to where your script is located, or give the complete path to it, e.g. /home/yourusername/Downloads/scriptname.sh.

Or you can use plain "su" which will give you root privileges and leave the current directory the same.

You can see the difference in action (the "~" means user's home directory, the first term in the prompt is the current user's name, the second is the current directory) :

[pcg@orpheus ~]$ su
[root@orpheus pcg]#

[pcg@orpheus ~]$ su -
[root@orpheus ~]#

"su" leaves me in pcg's home directory, while "su -" moves to root's home directory.

Another wrinkle here is that when you switch user the current PATH environment variable changes, which is where bash looks for things. So you might still have to include the full path to your script to get it to run, or use "./scriptname.sh", which means "look in the current directory".