UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
trying to export the path /usr/local/jdk/bin/ to my profile I guess, so I can use javac and what not, all those important java tools. When i use the command "export PATH=$PATH:/usr/local/jdk/bin" and then I type export to view the file, it is in there, but then when I type "source /etc/profile" to "reload" my profile like the instructions I was given said it would, it erases the path I just entered into the profile. I even checked it by typing "javac" afer I put it in, and it worked, then I typed the source command again, and tried typing "javac" again, and nothing. Can anyone help me with why this is just erasing the path I put in, instead of "reloading"? Thanks.
Yeah... when you export the new PATH, then source /etc/profile, it overwrites the PATH variable. If you want it to be persistent, you'll probably want to put it IN /etc/profile.
Yeah! I found that out earlier. I opened Profile in the text editor, but it would not let me edit it! I couldn't even type. It said I do not own the file, and it says it's owned by root. I'm the administrator! Why can't I edit it? Any ideas?
How do I log in as root? I thought I was root, since I am the only account. What does it mean to modify the path in ~/.bash_profile or ~/.profile? Do I type that in the terminal? thanks.
You should not be using root on a daily basis, and most distributions have you create a user account during setup.
~/.bash_profile and ~/.profile mean the files ".bash_profile" and ".profile" in your home directory. You can, as a user, open these and modify them to change your PATH for you.
To work as root, you'll need to use the 'su' utility.
Ubuntu uses sudo to allow a normal user administrative privileges. Thus the traditional UNIX 'root' account is disabled (i.e. it is not possible to log in as root). All the graphical configuration utilities use sudo by default. Thus when Synaptic or something similar asks you for a password, it is asking for your password.
Just to keep everyone up to date: MacaveliMC sent me an IM and I walked him through editing /etc/profile to modify the PATH set for both users and root. This seems to have resolved his problem.
"Just to keep everyone up to date: MacaveliMC sent me an IM and I walked him through editing /etc/profile to modify the PATH set for both users and root. This seems to have resolved his problem."
Matir could you please post that here I am running into a similar problem
Originally posted by pgsmith "Just to keep everyone up to date: MacaveliMC sent me an IM and I walked him through editing /etc/profile to modify the PATH set for both users and root. This seems to have resolved his problem."
Matir could you please post that here I am running into a similar problem
I am not trying to do anything with java I am just trying to set my path and it wont hold
Here is what I have right now
this part sets just fine
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
then I have
export PATH
PATH="$PATH:/u01/postware/adm:/u01/postware/ace:/u01/postware/cace:/u01/postware/presort:/u01/postware/merge:/u01/g1"
export PATH
PATH="$PATH"
and that is what is not setting I tried it all on the same line and that didn't work either
Where are you putting that command? Command line? /etc/profile? /home/user/.bashrc? If you are using bash and placing that line at your /home/user/.bashrc, you must make sure that your user has bash as the default shell too. Otherwise, if you try running a program (like gnome run or simply from another shell) it won't work.
To make sure that your user has bash as the current, default shell, open and edit your "/etc/passwd". You don't have to understand all the file (if you want I can explain every field though) just change the default shell for bash to your user. Specify the whole path (/usr/bin/bash) not a relative or command one (bash).
Remember also that changing /home/user/.bashrc will make the changes only for "user". If you need the same variables for user2, you will need to add those at /home/user2/.bashrc
Good luck!
Last edited by Mega Man X; 09-27-2005 at 10:50 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.