There's a symbolic link on my Linux machine which I want to update and point it to another location however I get permission denied error even though I have rwx permissions for the symbolic link:
$ ls -l /usr/bin/upgrades
lrwxrwxrwx 1 root root 18 Feb 16 2015 /usr/bin/upgrades -> upgrade
Here, /usr/bin/upgrades is a symbolic link to /usr/bin/upgrade which is a python script.
now, I want to point this symbolic link to another Python script in my home directory as shown below:
ln -sf test.py /usr/bin/upgrades
ln: cannot remove ‘/usr/bin/upgrades’: Permission denied
So, why do I get a permission denied error and also is there a way to update the symbolic link and point it to another location? I have rwx access to the symbolic link.
/usr/bin
in order to remove a file/add a file to that directory. If you look at the output of ln it seems likely that it just removes the existing link and adds a new one afterwards.