Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There's a GUI in Windows to edit the path variable. I was wondering if there's something equivalent in Ubuntu to do the same.

share|improve this question
There's no GUI available for the purpose. But its quite easy to do it the Command-line way. To read and understand fully about environment variables, checkout the official documentation regarding it- – saji89 May 26 '12 at 7:34
up vote 5 down vote accepted

Thing is... path is set inside several text files based on what you want to accomplish, like in ~/.profile for the user, /etc/profile as a default for users, /etc/environment for the system or /etc/bash.bashrc for system wide interactive bash shells. In some of these $PATH is set as part of some coding.

So a text editor is the most logical thing to use. Like gedit if you want it graphical but you will still be looking at the same type of deal as with nano or vi from commandline. But it will not be possible with something where you edit in some directories with an input box to browse directories since in Linux PATH can have some more logic to it than simply editing a variable.

My advice: get used to command line editing for things like this and similar things. It will one day help you fix your problems when not being able to login or Unity crashing just after login.

There is more likely to be a reason for it being done this way. Linux has many more ways of doing things then either of us will ever use but that does not mean someone else does not need them.

For Latex I would suggest adding it to /etc/bash.bashrc. That is the place to edit path for system wide bash shells.

gksu gedit /etc/bash.bashrc

After adding it in and saving you can check with

echo $PATH

if it is set correctly (and this will be permament).

share|improve this answer
My current objective is to set the PATH variable to: "/usr/local/texlive/2011/bin/i386-linux". But after I close the session, the system forgets the value of the PATH variable. So to initiate a simple task of running Latex on Ubuntu, I have to go to the folder, copy the path and set the variable each time I have to start using it. So I read different solutions to this problem. Some say edit bashrc, some say edit bash_profile, others say simply profile and some say edit bash_login. In all of this I am confused as to where PATH variable (which is guaranteed to load on login) located! – Shashank Sawant May 26 '12 at 7:08
In windows there's one place you can go to and edit the path variable. That edit will always work (even after system reboot). But because of all the problems windows has, I hate it. I like Ubuntu but currently I am trying to learn how Ubuntu overcomes the problems in windows. PATH variable has been a thing which has confused me a lot (especially the un-Pythonic way in which it is handled - there's no one way of editing it, every blog recommends a new method). – Shashank Sawant May 26 '12 at 7:12
You are doing something wrong if the path does not stick: like only setting it for this session. No one else seems to have problems with adding a path for latex ;) – Rinzwind May 26 '12 at 7:35
Yeah... mostly I am doing something wrong. But that is where my question lies: which is the surest way to set the PATH variable? My current method is to execute "PATH=/usr/local/texlive/2011/bin/i386-linux:$PATH". But after I reboot, the systems forgets the above assignment. – Shashank Sawant May 26 '12 at 7:37
I put in the most logical place to put this for latex. That command you use is for that session only. – Rinzwind May 26 '12 at 7:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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