6

I started installing utorrent wrt. When I try to install utorrent till this step it is fine

sudo chmod -R 777 /opt/utorrent-server-v3_0/

After this step when i proceed futher and giving the next command

sudo ln -s /opt/utorrent-server-v3_0/utserver /usr/bin/utserver

Then I get:

failed to create symbolic link ‘/usr/bin/utserver’: File exists

And the file in /usr/bin is broken.

Any idea how to fix this?

4 Answers4

9

You were attempting to create the link before and failed. Remove the link and try again:

sudo rm /usr/bin/utserver
sudo ln -s /opt/utorrent-server-v3_0/utserver /usr/bin/utserver
Braiam
  • 67,791
  • 32
  • 179
  • 269
6

You can also tell ln to ignore already existing files and just overwrite them using the -f (or --force) option:

sudo ln -sf /opt/utorrent-server-v3_0/utserver /usr/bin/utserver

Warning! Use this option with the same caution with which you would use rm - it does the same: deleting already existing files under that name!


Excerpt from man ln:

   -f, --force
          remove existing destination files
Byte Commander
  • 107,489
1

Its very simple!! I may be very late in answering but it'll be useful to late bees like me, also its very simple; You can resolve the above kind of issue with the following 2 steps:

  1. Delete your /usr/bin/utserver folder, Probably this folder will be empty, Copy the content, if you have anything important,
  2. Now try creating the SymLink as follows:

    ln -s /opt/utorrent-server-v3_0/utserver /usr/bin/utserver
    
GAD3R
  • 3,507
0

I got this error because I was trying to create a symlink in a folder that was mounted using sshfs.

Oddly the symlink is actually created however it looks like a normal file in the remote folder rather than a symlink. If you go to the actual server you can see that it has created the symlink correctly.

The issue in this case is the symlink looks like a real file in the remote server which is not what ln expected so it reports an error. Possibly playing with the mount options on sshfs will show the symlinks correctly e.g. follow_symlinks, transform_symlinks, direct_io, etc

Martin
  • 218