LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-13-2006, 06:41 PM   #1
nick623
Member
 
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83

Rep: Reputation: 15
can't create symlink to my home path


I recently installed firefox in my home directory. I wanted to symlink the executable to a directory thats already in my $PATH. I have $HOME/bin added to my $PATH. Firefox is located in $HOME/bin/firefox. When I try ln -s $HOME/bin/firefox/firefox $HOME/bin I get error message ln: `bin/firefox': cannot overwrite directory.
I know I can just add the firefox directory to my $PATH. But I think it's more effecient to just symlink the executable. I'm a relativey newbie and I haven't really used the symlink command much. So I'm sure the problem is something really obvious and simple.

If someone could help I would appreciate it.
Thanks.
 
Old 02-13-2006, 06:53 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
You're trying to create 2 objects with the same name in the one directory - a sub-directory called firefox that already exists and a link called firefox.

Can you install firefox somewhere else? /usr/lib/firefox-1.x.x is a popular location - even /usr/local/firefox-1.x.x or /opt/firefox-1.x.x would work. Then you can create the symlink again and it should work just fine.
 
Old 02-13-2006, 07:04 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Quote:
ln -s $HOME/bin/firefox/firefox $HOME/bin
Like the previous post said.

So use another link name
ls -s $HOME/bin/firefox/firefox $HOME/bin/Firefox (use capital F or any other name that isn't firefox)

Last edited by michaelk; 02-13-2006 at 07:08 PM.
 
Old 02-13-2006, 07:24 PM   #4
nick623
Member
 
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
Thanks for the ideas. Well I tryed the symlink command ln -s $HOME/bin/firefox/firefox $HOME/bin/Firefox(capitalized F). Now the Firefox symlink is displayed in red when i 'ls' it. And when I issue 'file' command to Firefox i get message "bin/Firefox: broken symbolic link to bin/firefox/firefox." Why is it broken now. Any ideas?
 
Old 02-13-2006, 07:30 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Now that's odd - I copy/pasted what you did into a terminal and it worked for me. Can you do `ls -l $HOME/bin/Firefox` and confirm that the location it is pointing to exists? For example:
Code:
$ ls -l $HOME/bin/Firefox
lrwxrwxrwx  1 websters websters 34 2006-02-14 11:18 /home/websters/bin/Firefox -> /home/websters/bin/firefox/firefox
$ ls -l /home/websters/bin/firefox/firefox
-rwxr-xr--  1 websters websters 0 2006-02-14 11:00 /home/websters/bin/firefox/firefox
 
Old 02-13-2006, 07:37 PM   #6
nick623
Member
 
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
Yeah here is what i get using ls -l.
total 4
drwx------ 12 newbie newbie 4096 Feb 13 20:32 firefox
lrwxrwxrwx 1 newbie newbie 19 Feb 13 20:49 Firefox -> bin/firefox/firefox

Except "Firefox -> bin/firefox/firefox" is all in red.
 
Old 02-13-2006, 07:39 PM   #7
nick623
Member
 
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
Here is what I get when I issue file command to Firefox.

file Firefox
Firefox: broken symbolic link to bin/firefox/firefox
 
Old 02-13-2006, 07:57 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
What does ls -l $HOME/bin/firefox/firefox display?
 
Old 02-13-2006, 08:19 PM   #9
nick623
Member
 
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
I went ahead and removed the symlink for now.
Here is what ls -l $HOME/bin/firefox/firefox displays.

ls -l bin/firefox/firefox
-rwx------ 1 5247 Jan 24 19:32 bin/firefox/firefox
 
Old 02-13-2006, 08:53 PM   #10
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Your $HOME/bin/firefox directory is on the same partition as the $HOME/bin directory isn't it? I get that error when I create symlinks to files on different partitions.
 
Old 02-13-2006, 09:03 PM   #11
nick623
Member
 
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
Yeah there on the same directory. I have simple set up very few partitions.

I wonder if I moved the firefox to another $HOME directory called "programs" or something like that and created a symlink to it in $HOME/bin would be different?
I don't know, wierd.
 
Old 02-13-2006, 09:19 PM   #12
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Even moving the directory to $HOME/bin/firefox-1.5 should allow a link from $HOME/bin/firefox-1.5/firefox to $HOME/bin/firefox. But yes, moving it to somewhere else will do the trick (as long as the symlink is on the same partition as the file it points to).
 
Old 02-13-2006, 09:22 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Quote:
Originally Posted by nick623
Yeah here is what i get using ls -l.
total 4
drwx------ 12 newbie newbie 4096 Feb 13 20:32 firefox
lrwxrwxrwx 1 newbie newbie 19 Feb 13 20:49 Firefox -> bin/firefox/firefox

Except "Firefox -> bin/firefox/firefox" is all in red.
The link should point to the entire path i.e
Firefox -> /home/username/bin/firefox/firefox.

For some reason $HOME environment variable does not appear to be assigned anything. You can see from gilead's post
$HOME expands to /home/websters.

Instead of $HOME you can use the full path in your link statement.
BTW what is the output of
echo $HOME
 
Old 02-13-2006, 09:36 PM   #14
nick623
Member
 
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
My $HOME variable is set correctly. Here is what I get when I issue the command "echo $Home" /home/newbie. I believe the problem may have been I didn't use an absolute path but a relative path.

Anyway. I did finally got the symlink to work. I moved the firefox directory to a new directory "program_files" and made a symlink to it in my home directory. It seems to be working fine!

Thanks guys for your help.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
symlink home-directory? SteQve Linux - General 2 01-26-2006 04:42 PM
How do I create a symlink? mouldy_punk Linux - General 6 01-12-2006 02:55 PM
manually create a symlink in konqi's remote folder Randall Slack Linux - Software 1 12-08-2005 11:28 AM
What is a symlink and how do I create one. Zog_dev Linux - General 2 09-10-2003 03:08 PM
create symlink with an option,e.g. gunzip & gzip,how? l_9_l Linux - General 1 05-15-2002 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:46 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