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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
02-13-2006, 07:41 PM
|
#1
|
Member
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83
Rep:
|
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.
|
|
|
02-13-2006, 07:53 PM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
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.
|
|
|
02-13-2006, 08:04 PM
|
#3
|
Moderator
Registered: Aug 2002
Posts: 26,521
|
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 08:08 PM.
|
|
|
02-13-2006, 08:24 PM
|
#4
|
Member
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83
Original Poster
Rep:
|
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?
|
|
|
02-13-2006, 08:30 PM
|
#5
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
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
|
|
|
02-13-2006, 08:37 PM
|
#6
|
Member
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83
Original Poster
Rep:
|
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.
|
|
|
02-13-2006, 08:39 PM
|
#7
|
Member
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83
Original Poster
Rep:
|
Here is what I get when I issue file command to Firefox.
file Firefox
Firefox: broken symbolic link to bin/firefox/firefox
|
|
|
02-13-2006, 08:57 PM
|
#8
|
Moderator
Registered: Aug 2002
Posts: 26,521
|
What does ls -l $HOME/bin/firefox/firefox display?
|
|
|
02-13-2006, 09:19 PM
|
#9
|
Member
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83
Original Poster
Rep:
|
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
|
|
|
02-13-2006, 09:53 PM
|
#10
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
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.
|
|
|
02-13-2006, 10:03 PM
|
#11
|
Member
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83
Original Poster
Rep:
|
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.
|
|
|
02-13-2006, 10:19 PM
|
#12
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
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).
|
|
|
02-13-2006, 10:22 PM
|
#13
|
Moderator
Registered: Aug 2002
Posts: 26,521
|
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
|
|
|
02-13-2006, 10:36 PM
|
#14
|
Member
Registered: Dec 2004
Distribution: Fedora, Ubuntu
Posts: 83
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 02:51 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.
|
Latest Threads
LQ News
|
|