[opensuse] where can I change $PATH
Hi, I've got an application installed from OpenSuse's repository which is in $PATH. Recently I installed a newer version as binary in /opt. Now I'd like to remove the bin-directory of the older version and replace it with the newer version under /opt. I know I could add the newer bin to $PATH in /etc/bash.bashrc.local but I rather like to remove the old one. I'd like to keep the old binary at least for now so it's no solution to delete the package and let YaST clean up $PATH. Is there a central cfg-file where $PATH is defined? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 10/2/2011 12:39 AM, Andreas wrote:
Hi,
I've got an application installed from OpenSuse's repository which is in $PATH. Recently I installed a newer version as binary in /opt.
Now I'd like to remove the bin-directory of the older version and replace it with the newer version under /opt. I know I could add the newer bin to $PATH in /etc/bash.bashrc.local but I rather like to remove the old one. I'd like to keep the old binary at least for now so it's no solution to delete the package and let YaST clean up $PATH.
Is there a central cfg-file where $PATH is defined?
You don't want to remove any of the stock directories from PATH. 1st - search for a properly packaged newer version of the app at build.opensuse.org. Install that rpm and it takes care of everything. Failing that, it's messy and not advised, but Install your new local-self-compiled to /usr/local/bin by using the apps ./configure --prefix=/usr/local ; make install Then remove the old app with "zypper rm appname". From what little you've said, so far there is not enough justification to mess with PATH. There is no single place PATH is defined. It is defined differently in different contexts (init, root vs not root, ssh remote exec, ssh login, local console login, X, cgi, cron, ...) and in most of those contexts it is defined by a several step process of setting some value initially and then having parts appended, prepended or wholesale replaced. You could put the new app in /opt/newapp/bin and put PATH=/opt/newapp/bin:$PATH in /etc/profile.local That will affect all subsequent interactive logins, and nothing else, not cron jobs, not initrc scripts, not cgi's etc. The file either doesn't exist or is empty at first, you just create it and put that line in. /etc/profile (which you should not edit) already tries to source /etc/profile.local near the end. /etc/profile only gets read at login-time though. That will put the newapp bin in ahead of all other PATH so it doesn't matter if the old version stays installed. This is really not a great idea though. PATH can be a security concern. If you didn't have closed permissions on the new bin dir, then a bad program could put a replacement "ls" or something in that bin dir and then it would get used instead of /bin/ls. It only takes one binary or script to get executed one time to completely own your box and even remove all the easy evidence for you to even know it ever happened, in a fraction of one second. -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 10/02/2011 02:37 AM, Brian K. White pecked at the keyboard and wrote:
On 10/2/2011 12:39 AM, Andreas wrote:
Hi,
I've got an application installed from OpenSuse's repository which is in $PATH. Recently I installed a newer version as binary in /opt.
Now I'd like to remove the bin-directory of the older version and replace it with the newer version under /opt. I know I could add the newer bin to $PATH in /etc/bash.bashrc.local but I rather like to remove the old one. I'd like to keep the old binary at least for now so it's no solution to delete the package and let YaST clean up $PATH.
Is there a central cfg-file where $PATH is defined?
You don't want to remove any of the stock directories from PATH.
1st - search for a properly packaged newer version of the app at build.opensuse.org. Install that rpm and it takes care of everything.
What part of "I'd like to keep the old binary" isn't understood here! Simply put the "/opt" path earlier in the path statement as the one first found will run. You can always enter the full path to the openSuSE app to run it. But make sure ALL of the newer version (including libs) is installed under /opt before installing it otherwise you will have problems. and the proper place to change $PATH is in your .profile file. -- Ken Schneider SuSe since Version 5.2, June 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Am 02.10.2011 08:37, schrieb Brian K. White:
You don't want to remove any of the stock directories from PATH.
OK, I disregarded that OpenSuse stuffs more or less every binary in just a couple of bin-dirs so removing this bin wouldn't be exactly helpfull.
1st - search for a properly packaged newer version of the app at build.opensuse.org. Install that rpm and it takes care of everything. This is the issue. AFAIK the most recent PostgreSQL server in the repositories is 9.0.4 and even this is in an additional repo and not the standard 11.4. I had to install the binaries compiled by EnterpriseDB which don't come as rpm and aren't added to the package management. It seemed advisable to fetch the latest security patched version and don't wait till OS12.1 comes out.
That will affect all subsequent interactive logins, and nothing else, not cron jobs, not initrc scripts, not cgi's etc. So I'll need to change my scripts that get run by cron to use full paths instead of letting bash search $PATH. Thats a wee bit incovenient but so what.
thanks -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 10/2/2011 11:16 PM, Andreas wrote:
Am 02.10.2011 08:37, schrieb Brian K. White:
You don't want to remove any of the stock directories from PATH.
OK, I disregarded that OpenSuse stuffs more or less every binary in just a couple of bin-dirs so removing this bin wouldn't be exactly helpfull.
That is how all unix works, not opensuse.
1st - search for a properly packaged newer version of the app at build.opensuse.org. Install that rpm and it takes care of everything. This is the issue. AFAIK the most recent PostgreSQL server in the repositories is 9.0.4 and even this is in an additional repo and not the standard 11.4. I had to install the binaries compiled by EnterpriseDB which don't come as rpm and aren't added to the package management. It seemed advisable to fetch the latest security patched version and don't wait till OS12.1 comes out.
That will affect all subsequent interactive logins, and nothing else, not cron jobs, not initrc scripts, not cgi's etc. So I'll need to change my scripts that get run by cron to use full paths instead of letting bash search $PATH. Thats a wee bit incovenient but so what.
If you want to add a directory to PATH for all cron jobs, you can do that in /etc/crontab If you only need to add the special dir to PATH for one or a few scripts, you can do that right in the script itself, anywhere near the top, before the special commands get run. PATH=/opt/foo:$PATH for other contexts, other things. Using full explicit paths to individual commands in scripts is the shortsighted, inflexible, quickest broken and easiest broken way so you don't want to do that. -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Brian K. White said the following on 10/03/2011 01:51 AM:
On 10/2/2011 11:16 PM, Andreas wrote:
Am 02.10.2011 08:37, schrieb Brian K. White:
You don't want to remove any of the stock directories from PATH.
OK, I disregarded that OpenSuse stuffs more or less every binary in just a couple of bin-dirs so removing this bin wouldn't be exactly helpfull.
That is how all unix works, not opensuse.
All this seems to indicate that learning some - a lot - UNIX fundamentals (there are many books and web sites) is in order her. -- If we believe absurdities, we shall commit atrocities. -- Voltaire -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
... ...
That is how all unix works, not opensuse.
All this seems to indicate that learning some - a lot of - UNIX fundamentals (there are many books and web sites) is in order here.
Agree. However, many books and websites out there are either hopelessly outdated, or specifically focused on niche situations and/or other distributions, or just plain crap. Does anyone have any good suggestions here? Any specific website or book (I always prefer books!) that you found helpful in learning how GNU/Linux/UNIX works? Haro -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, Oct 3, 2011 at 7:02 AM, Haro de Grauw
...
...
That is how all unix works, not opensuse.
All this seems to indicate that learning some - a lot of - UNIX fundamentals (there are many books and web sites) is in order here.
Agree. However, many books and websites out there are either hopelessly outdated, or specifically focused on niche situations and/or other distributions, or just plain crap.
Does anyone have any good suggestions here? Any specific website or book (I always prefer books!) that you found helpful in learning how GNU/Linux/UNIX works?
Almost anything by Mark Sobel is worthwhile. -- JAY VOLLMER I write technical manuals; therefore, I am a manual laborer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Haro de Grauw
Agree. However, many books and websites out there are either hopelessly outdated, or specifically focused on niche situations and/or other distributions, or just plain crap.
Does anyone have any good suggestions here? Any specific website or book (I always prefer books!) that you found helpful in learning how GNU/Linux/UNIX works?
RUTE user's guide (by Paul Sheer) is very good but somewhat dated. search google or: http://www.linux-books.us/gnoppix_0001.php -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 10/03/2011 09:17 AM, Patrick Shanahan pecked at the keyboard and wrote:
* Haro de Grauw
[10-03-11 08:02]: Agree. However, many books and websites out there are either hopelessly outdated, or specifically focused on niche situations and/or other distributions, or just plain crap.
Does anyone have any good suggestions here? Any specific website or book (I always prefer books!) that you found helpful in learning how GNU/Linux/UNIX works?
RUTE user's guide (by Paul Sheer) is very good but somewhat dated.
search google or: http://www.linux-books.us/gnoppix_0001.php
Also look under /usr/share/doc and there are docs that can be installed from the DVD. Any book on *nix administration is a good start to learn basics. Also check online (Amazon) for O'Reilly books. -- Ken Schneider SuSe since Version 5.2, June 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Haro de Grauw said the following on 10/03/2011 08:02 AM:
... ...
That is how all unix works, not opensuse.
All this seems to indicate that learning some - a lot of - UNIX fundamentals (there are many books and web sites) is in order here.
Agree. However, many books and websites out there are either hopelessly outdated, or specifically focused on niche situations and/or other distributions, or just plain crap.
As far as distribution specifics go, you are right; as far as the effect of many new features go, you are right. But when it comes to things like $PATH, the difference between running a script, sourcing a script and interpreting a script; these matters are the same today as they were ten or twenty years ago. The "Yellow Book", the BSTJ July/Aug 1978 (vol 57, No 6, part 2) has the basic articles on UNIX and Steve Bourne's article on the Shell and everything in that article is still valid today (though Bash has a lot more!) That article covers $PATH, execution, sourcing and interpretation, expansion of variables, wild cards and file names and so forth. Some of these matters have come up recently. They haven't changed, they are not niche matters. What Steve Bourne wrote about in 1978 about $PATH is not outdated. These are FUNDAMENTALS.-- "You don't concentrate on risks. You concentrate on results. No risk is too great to prevent the necessary job from getting done." - Charles Yeager. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Andreas wrote:
AFAIK the most recent PostgreSQL server in the repositories is 9.0.4 and even this is in an additional repo and not the standard 11.4. I had to install the binaries compiled by EnterpriseDB which don't come as rpm and aren't added to the package management. It seemed advisable to fetch the latest security patched version and don't wait till OS12.1 comes out.
You haven't said why you need a more recent PostgreSQL, so I can only speculate. But I don't think you need a more recent version in order to get security patches. Security patches for the version that shipped with opensuse 11.4 will continue to be provided whilst 11.4 is in support. That is what support means! Using a more recent version means that you will have to monitor and apply security patches yourself and will mean that you will encounter different problems from other opensuse users. Depending on what you're trying to do, that may or may not be what you want. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 02 October 2011 06:39:07 Andreas wrote:
Hi,
I've got an application installed from OpenSuse's repository which is in $PATH. Recently I installed a newer version as binary in /opt.
Now I'd like to remove the bin-directory of the older version and replace it with the newer version under /opt. I know I could add the newer bin to $PATH in /etc/bash.bashrc.local but I rather like to remove the old one. I'd like to keep the old binary at least for now so it's no solution to delete the package and let YaST clean up $PATH.
Is there a central cfg-file where $PATH is defined?
I think maybe you have misunderstood what $PATH is. You don't have binaries in that variable, you have directories which are to be searched for binaries. So removing the old binary would mean removing the directory it is in, and then you would lose every other binary in there. The correct solution is the one you fould yourself, to add the new directory where your new binary is, to $PATH, either first, or at least before the directory where the old binary is Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Anders Johansson
I think maybe you have misunderstood what $PATH is. You don't have binaries in that variable, you have directories which are to be searched for binaries. So removing the old binary would mean removing the directory it is in, and then you would lose every other binary in there.
The correct solution is the one you fould yourself, to add the new directory where your new binary is, to $PATH, either first, or at least before the directory where the old binary is
Or, quick/easy, simply add an alias to the user which calls the wanted app by a different name or the same name and defines the *wanted* app. ~/.alias alias [app-name]=/path/to/wanted-app the aliased app will be called before bash accesses $PATH When/if you decide which app is the more desirable, remove the unwanted app and the alias (not really necessary but *cleaner*).. -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (9)
-
Anders Johansson
-
Andreas
-
Anton Aylward
-
Brian K. White
-
Dave Howorth
-
Haro de Grauw
-
Jay Vollmer
-
Ken Schneider - openSUSE
-
Patrick Shanahan