LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-08-2005, 08:00 PM   #1
tcv
Member
 
Registered: Apr 2003
Location: Billerica, MA
Posts: 114

Rep: Reputation: 15
I messed up my PATH...


In the course of installing 'convert,' there were several export commands to run to make it work. In some cases, though, I misspelled items and/or didn't include quotes where I should.

Soooo... I am wondering that...

1. Where do these export commands 'go'?

2. How can I clean this up?

Whoops... I did mess up my PATH.

bash can't find cp, rm, and other commands.

I'm .. ah... screwed huh?

More info. I am running SuSE 9.2 and I executed these commands as myself, not su.

m

Last edited by tcv; 01-08-2005 at 08:22 PM.
 
Old 01-08-2005, 08:32 PM   #2
tcv
Member
 
Registered: Apr 2003
Location: Billerica, MA
Posts: 114

Original Poster
Rep: Reputation: 15
Ok...

I think things are okay, but I am confused by the results.

When I ran the export commands, I ran than under my username, not 'su'. And after I performed these operations, I could run convert, but not other commands like cp.

So, I just closed that terminal session. (I'm in SuSE in KDE.) I reopened a new terminal session and common commands work like cp, mv, etc.

But now convert doesn't work.

Ultimately, I'd like 'convert' and the other commands to work. ;-)

WhaddaIdowrong?
 
Old 01-08-2005, 08:32 PM   #3
zoiks
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.1 Pro on Intel 2.4GHz (Dell Optiplex GX260)
Posts: 20

Rep: Reputation: 0
1) If all you did was export paths, then you will get your regular paths back by re-loggin in or restarting your computer. export variables are only stored in RAM, not in disk.

2) If you fubar'ed your /etc/profile file, then you need to find a way to re-establish your paths in that file. You'll want to make sure the regular paths are there, like

/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin

and add any distro-specific stuff to it, like /opt/firefox or /opt/kde3/bin.

"export" commands put or modify variables in your "environment". Environments are inherited from the shell that started them. If you want to see the value of the PATH variable, you can type "echo $PATH".

You can also add paths within the .bashrc file.
 
Old 01-08-2005, 08:40 PM   #4
zoiks
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.1 Pro on Intel 2.4GHz (Dell Optiplex GX260)
Posts: 20

Rep: Reputation: 0
Quote:
Originally posted by tcv

Ultimately, I'd like 'convert' and the other commands to work. ;-)

WhaddaIdowrong?
Convert (I assume you mean ImageMagick's convert) should have been installed in a "regular" place. In my SuSE distro, it's in /usr/bin. Of course, your installation should have put convert in a place accessible to your PATH for you.

If convert is in your path, you can type "whereis convert" and it will respond with the location. If you have convert in a "special place" and you don't want to put it in /usr/bin or somwhere like that, then you can link to it with a command like "ln -s /path/to/convert /usr/bin/convert". Or, you can just add the location of convert to your path from within /etc/profile or $HOME/.bashrc.
 
Old 01-08-2005, 09:21 PM   #5
tcv
Member
 
Registered: Apr 2003
Location: Billerica, MA
Posts: 114

Original Poster
Rep: Reputation: 15
I do mean ImageMagick.

Well, I don't quite understand how to install it.

Are you saying I should copy the entire ImageMagick-6.1.8 folder into /bin/?

There are environment variables to set, though, that point out to convert where its lib folder resides.

I'll look again through the install notes. I obviously didn't understand...

And, I don't understand what you mean by etc/profile.

Thanks!

m
 
Old 01-08-2005, 09:51 PM   #6
tcv
Member
 
Registered: Apr 2003
Location: Billerica, MA
Posts: 114

Original Poster
Rep: Reputation: 15
Well, it seems to me I can go two routes with this...

1. Create a profile.local that exports the items listed in QuickStart.html. That way, I can specify the manual location of ImageMagick. (Right now it's in "$HOME/bin/".)

2. Download the SOURCE instead of the binary, and make INSTALL.

m
 
Old 01-08-2005, 09:51 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
/etc/profile is the system wide environment. This is the default for all users. It doesn't appear that you messed with this file. The individual users profile is a hidden file in your home directory called .bash_profile. You can change the path here too.

When you added the commands you overwrite the existing path environment with a new one. That is why cp etc. didn't work. And as you found out the the new environment was only valid for the current shell. When you opened a new terminal window you could not use the convert command because the environment didn't include the new commands anymore.

So just add the new commands to the .bash_profile file for your user.
 
Old 01-08-2005, 09:57 PM   #8
tcv
Member
 
Registered: Apr 2003
Location: Billerica, MA
Posts: 114

Original Poster
Rep: Reputation: 15
There is no .bash_profile in my home folder, however there is a .profile.

There is also an /etc/profile. There's a warning in there to create a .profilelocal if I want to create my own settings. And I see a check in profile for the existence of the local profile.

But wouldn't I have to create an export path that included the places that are ALSO in the global profile INCLUDING the convert stuff?

m
 
Old 01-08-2005, 10:08 PM   #9
zoiks
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.1 Pro on Intel 2.4GHz (Dell Optiplex GX260)
Posts: 20

Rep: Reputation: 0
If the executable binaries are sitting in $HOME/bin, just add the line

export PATH=$HOME/bin:$PATH

to your local profile. Frankly, I'm surprised your profile isn't setting up $HOME/bin already. Don't worry, the regular profile stuff will still work fine.
 
Old 01-08-2005, 10:09 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Yes, but here is a shortcut.
PATH=$PATH:$HOME/bin

This will add $HOME/bin to to the existing $PATH.

For example the system default path defined by /etc/profile is:
/local/bin:/sbin:/usr/local/bin

After you log in your path will be
/local/bin:/sbin:/usr/local/bin:/home/user/bin

$HOME is an environment variable for your home directory.
 
Old 01-08-2005, 10:25 PM   #11
tcv
Member
 
Registered: Apr 2003
Location: Billerica, MA
Posts: 114

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by zoiks
to your local profile. Frankly, I'm surprised your profile isn't setting up $HOME/bin already. Don't worry, the regular profile stuff will still work fine.
It is setting up $HOME/bin.

But how does it find all the rest of it? ImageMagick has a library, as I'm sure you know, that's set up with an environment variable.

export LD_LIBRARY_PATH="$HOME/ImageMagick-6.1.2/lib"

Finally, you are suggesting that I create the .profilelocal?

And what of the rest of it? The man pages, for instance.

m

Last edited by tcv; 01-08-2005 at 10:26 PM.
 
Old 01-08-2005, 10:41 PM   #12
tcv
Member
 
Registered: Apr 2003
Location: Billerica, MA
Posts: 114

Original Poster
Rep: Reputation: 15
Okay, so here's what I'm thinking about doing.

1. Create a local profile that will be loaded along with the global profile.

2. The local profile will contain the following commands:

PATH=$PATH:$HOME/bin/ImageMagick-6.1.8
export MAGICK_HOME="$HOME/bin/ImageMagick-6.1.8"
export LD_LIBRARY_PATH="$HOME/bin/ImageMagick-6.1.8/lib"

Line 1 adds $HOME/bin/ImageMagick-6.1.8 to the GLOBAL PATH
Line 2 sets the MAGICK_HOME variable
Line 3 sets the LD_LIBRARY_PATH variable

EDIT: No, that didn't work. No addition to the path.

P.S. I just found out that I could install it via YaST. That just doesn't seem right. ;-)

Last edited by tcv; 01-08-2005 at 10:52 PM.
 
  


Reply



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
Image Path reference in Linux (Absolute path) javabuddy Linux - General 7 06-05-2006 07:45 AM
Apache path and kde path questions darkraider Debian 1 11-12-2005 05:07 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
Removing path form PATH maginotjr Linux - Newbie 3 02-12-2005 02:23 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 06:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:23 PM.

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