LinuxQuestions.org
Visit Jeremy's Blog.
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-24-2020, 05:50 PM   #1
susja
Member
 
Registered: May 2011
Posts: 116

Rep: Reputation: 1
Unable to remove symbolic link


I installed cygwin64 on my PC and then from terminal created some symlinks like this:
%ln -s /cygdrive/c /c
%ln -s /cygdrive/z /z
After that by mistake I created wrong link:
%ln -s /cygdrive/x /z
and
%ln -s /cygdrive/z /z
Then I realized it and wanted to remove 'x' and 'z' symlink but failed.
I have this picture:
pwd: /cygdrive/z
$ ls -l
total 58
drwxrwx---+ 1 VHA01+User(214401) Domain Users 0 Sep 23 16:28 abcLZ
-rwxrwx---+ 1 Unknown+User Unknown+Group 1404 Jan 13 22:20 'Shortcut to abcLZ.lnk'
-rwxrwx---+ 1 Unknown+User Unknown+Group 47104 Dec 13 15:06 Thumbs.db
lrwxrwxrwx 1 Unknown+User Unknown+Group 1 Jul 31 08:12 x -> z
lrwxrwxrwx 1 Unknown+User Unknown+Group 1 Jul 31 08:12 z -> z
--
pwd: /cygdrive/z
$ rm x
rm: remove symbolic link 'x'? yes
rm: cannot remove 'x': Permission denied
vhabhsvoldme@BOS-WSRES186018 /cygdrive/z
$ rm /cygdrive/z/x
rm: remove symbolic link '/cygdrive/z/x'? y
rm: cannot remove '/cygdrive/z/x': Permission denied
--
pwd: /cygdrive/z
/cygdrive/z
$ chown <myaccount> x
chown: cannot dereference 'x': Too many levels of symbolic links
***
Hence I'm stuck and can't remove symlink 'x' and 'z'. Could anyone please help me to get rid of it? Thanks
 
Old 01-24-2020, 10:03 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,591

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
does that thing have root? if yes go root (sudo / su) then try to delete it.
 
Old 01-24-2020, 11:05 PM   #3
susja
Member
 
Registered: May 2011
Posts: 116

Original Poster
Rep: Reputation: 1
Well this is Windows and does not have ‘root’
I have only one account for this PC to login and I created those links with this account
Thanks
 
Old 01-24-2020, 11:15 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,591

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
try reading up on this
https://cygwin.com/problems.html
 
Old 01-24-2020, 11:20 PM   #5
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,360

Rep: Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523
Perhaps read through this section of the documentation. Iím not sure which would apply in your case

Please share the solution here if you figure it out.
 
Old 01-26-2020, 11:45 AM   #6
susja
Member
 
Registered: May 2011
Posts: 116

Original Poster
Rep: Reputation: 1
I followed the document. It did not help to solve my issue ..
I tried to delete symlink z. It worked but when I created it again … I've got back x link
I did the following:
ln -s /cygdrive/z /z
=> ls -l z/?
lrwxrwxrwx 1 Unknown+User Unknown+Group 1 Jul 31 08:12 z/x -> z
lrwxrwxrwx 1 Unknown+User Unknown+Group 1 Jul 31 08:12 z/z -> z
| => cd z total 58K
drwxrwx---+ 1 VHA01+User(214401) 0 Jan 24 09:41 LimsLZ/
-rwxrwx---+ 1 Unknown+User 1.4K Jan 13 22:20 'Shortcut to LimsLZ.lnk'
-rwxrwx---+ 1 Unknown+User 46K Dec 13 15:06 Thumbs.db
lrwxrwxrwx 1 Unknown+User 1 Jul 31 08:12 x -> z
lrwxrwxrwx 1 Unknown+User 1 Jul 31 08:12 z -> z
=> rm x rm: remove symbolic link 'x'? yes
rm: cannot remove 'x': Permission denied
 
Old 01-26-2020, 12:44 PM   #7
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,576

Rep: Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341Reputation: 4341
I would try to do it directly from windows, not from cygwin.
 
Old 01-26-2020, 03:08 PM   #8
susja
Member
 
Registered: May 2011
Posts: 116

Original Poster
Rep: Reputation: 1
Already tried
Thanks
 
Old 01-27-2020, 07:03 PM   #9
susja
Member
 
Registered: May 2011
Posts: 116

Original Poster
Rep: Reputation: 1
I am all set now.
The solution was to remove the link on server
 
  


Reply

Tags
cygwin


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Physical link vs Relative link vs Symbolic link hack3rcon Linux - Newbie 13 01-13-2018 11:48 AM
[SOLVED] Can I make a symbolic link that is dynamic link->$HOME/file? croog Linux - General 4 10-14-2012 08:55 PM
Symbolic link not allowed or link target not accessible rheluser Linux - Server 3 09-04-2012 11:22 AM
symbolic link not allowed or link target not accessible paullaubscher Linux - Newbie 4 03-10-2010 07:47 AM
How to create symbolic link to html file and avoid page link problem? haxpor Linux - General 2 01-29-2008 08:40 AM

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

All times are GMT -5. The time now is 03:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration