LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-21-2005, 09:00 PM   #1
PSIPHON
Member
 
Registered: Jul 2005
Distribution: SuSe 10.0
Posts: 39

Rep: Reputation: 15
cant access normal programs/commands


So installed an interesting peice of software and now i am unable to do all the simple stuff like pkgtool, rpm2tgz etc.

Im going to asume that there is normaly some sort of link to all the /usr/bin and /sbin apps but i dont know how to recreate them.

If some one could show me the commands it oculd be greatly appreciated
 
Old 07-21-2005, 09:07 PM   #2
[NL]_Target
Member
 
Registered: Aug 2003
Distribution: Arch Linux 0.7
Posts: 81

Rep: Reputation: 15
Hi PSIPHON,

There are no such links to /usr/bin and /sbin aps, linux uses a variable called the PATH variable (or $PATH). Try 'echo $PATH' on a shell to see what your current PATH is. Any executable program in your PATH (so if your PATH is /usr/bin:/sbin then any program in those directory's) is executable by just typing it's name. I think the program you installed either messed up your path, or did something nasty I don't know of. Try running 'su -' (with the "-" sign!) if you can't fix your path (/bin/su is the full path on Arch Linux) to become root. If your program's do work when logged in as root, then the problem is that your PATH as a normal user is wrong.

Tell me how it goes, so we can find a way to fix this.

Marno
 
Old 07-21-2005, 09:16 PM   #3
PSIPHON
Member
 
Registered: Jul 2005
Distribution: SuSe 10.0
Posts: 39

Original Poster
Rep: Reputation: 15
Ok, i used the # su - and was able to run pkgtool, then exited back to normal user and was not able to, there are a bing of things on the path but /sbin is not one of them. How might i be able to correct this?

Also what is the difference between '# su -' and just '#su' ?

Thanks in advance

[edit]: pkgtool was a poor example i tried to use fdisk and it failed as a normal user

Last edited by PSIPHON; 07-21-2005 at 09:18 PM.
 
Old 07-21-2005, 09:21 PM   #4
PSIPHON
Member
 
Registered: Jul 2005
Distribution: SuSe 10.0
Posts: 39

Original Poster
Rep: Reputation: 15
Oh yeah, I also installed firefox, this might go in the same catagorey as my other question, how might i make it so that i can just type '# firefox' and get a new instance of firefox each time?
 
Old 07-21-2005, 10:09 PM   #5
[NL]_Target
Member
 
Registered: Aug 2003
Distribution: Arch Linux 0.7
Posts: 81

Rep: Reputation: 15
let's fix the problems one by one :-).

1. Fixing the normal user path.

You should look in your home directory (typically /home/username) and open the file '.bashrc' with a text editor of your choice (try an easy one like nano / gedit / joe). There is probably a reference to your path variable in your file like:

PATH=/bla/bla/bla

whatever it is, add this:

:/sbin so it reads:

PATH=/bla/bla/bla:/sbin

You can add additional directories by using the ':' sign and then the path. Easy eh? Then save the file, logout & login and it should be fixed.

2. Difference between 'su' and 'su -'

su - creates a login shell, this gives you the 'true' root shell, ea: it's exactly the same as if you logged in as root from the login prompt.

su 'only' gives you the root permissions, but keeps your current information like PATH and stuff like that, so thats why your path does not change when you use 'su' (and so, the programs that are in root's path are not accessible by just typing their full name).

3. Linking firefox so you can start it with the command 'firefox' and get a new instance each time.

This is actually a tricky one, but there are existing solutions for this. I've googled around a bit and these sites looked good:

http://www.wlug.org.nz/MozillaFirefoxStartupScript
http://kb.mozillazine.org/Firefox_:_...tance_in_Linux

If these not work, I might have some old perl script hanging around somewhere to do the job, but I think those sites will work.

You should try the scripts they mention on those sites, and download them.

Then move them to the correct folder and give them the correct permissions:

Code:
mv /home/username/<path to downloaded script>/scriptname.sh /usr/bin/firefox
chmod +x /usr/bin/firefox
That should do the trick! Good luck,

Marno

Last edited by [NL]_Target; 07-21-2005 at 10:10 PM.
 
Old 07-22-2005, 02:28 AM   #6
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
There's a good reason why /sbin and the like are only on root's path. It's because programs like fdisk and pkgtool are system administration programs, they only work if you are root, and in the Unix philosophy only root can and should do system administration tasks.

So putting these paths on your PATH will not be enough. You would also have to acquire root priviledges, either via su or sudo.
 
Old 07-22-2005, 07:58 AM   #7
PSIPHON
Member
 
Registered: Jul 2005
Distribution: SuSe 10.0
Posts: 39

Original Poster
Rep: Reputation: 15
Correct, perhaps im recalling (this was mu first run through before reformatting) when i ran X as root (sorry :P) and was installing software like that. so it probably just a misunderstanding on my part.

But, at the same time i am learing new things again and im always grateful for that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Commands in C++ Programs revolutionary_era Linux - Newbie 2 09-30-2005 04:06 PM
normal user access folders jwijesundra Linux - Newbie 3 01-16-2005 10:46 AM
getting access denied , when trying to access camera as normal user bennythepitbull Linux - Hardware 2 11-04-2003 02:30 AM
programs of commands nitk Linux - Newbie 1 10-24-2003 11:54 PM
compiling commands/programs? ptolbert Linux - Newbie 2 12-21-2001 12:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration