0

I have all the necessary permission to delete the folder

ls -l
drwxrwxrwx 1 user user 4096 Oct 15 16:20 WindowsApps

However on trying to delete the folder

sudo rm -r -f WindowsApps
rm: cannot remove 'WindowsApps/Microsoft.GamingApp_2008.1001.11.0_neutral_split.scale-125_8wekyb3d8bbwe/Assets': Directory not empty
rm: cannot remove 'WindowsApps/Microsoft.GamingApp_2008.1001.11.0_neutral_~_8wekyb3d8bbwe/AppxMetadata/AppxBundleManifest.xml': No such file or directory
rm: cannot remove 'WindowsApps/Microsoft.GamingApp_2008.1001.11.0_x64__8wekyb3d8bbwe/AppxMetadata/CodeIntegrity.cat': No such file or directory
rm: cannot remove 'WindowsApps/Microsoft.GamingApp_2008.1001.11.0_x64__8wekyb3d8bbwe/Assets/JumpList': Directory not empty
rm: cannot remove 'WindowsApps/Microsoft.GamingApp_2008.1001.11.0_x64__8wekyb3d8bbwe/Bundle/assets/src/windows/app/assets': Directory not empty
rm: cannot remove 'WindowsApps/Microsoft.GamingApp_2008.1001.11.0_x64__8wekyb3d8bbwe/Bundle/index.bundle': No such file or directory
rm: cannot remove 'WindowsApps/Microsoft.GamingApp_2008.1001.11.0_x64__8wekyb3d8bbwe/microsoft.system.package.metadata': Directory not empty

Even when i try deleting individual files by cd into the folder

sudo rm -r AppxBundleManifest.xml
rm: cannot remove 'AppxBundleManifest.xml': No such file or directory

The folder is a remnant of Windows Xbox game pass and its corresponding windows installation has been deleted.I have also tried deleting from a new windows installation.This folder is located on my external hdd where the other folders are not effected by this behavior.

ls -l for a file in the folder

-rwxrwxrwx 2 user user 12502 Aug 30 01:26 AppxBundleManifest.xml
5
  • Welcome, the drive we assume is NTFS. Perform disk check and see if that solves the problem. Oct 15 '20 at 11:20
  • you are missing info: please also provide ls -l for the file you get this error on. and please tell us the mount options if any,
    – Rinzwind
    Oct 15 '20 at 11:24
  • Updated with the file permissions , the hdd is NTFS formatted mounted on ‘/media/user/67CBAF013605A3AF’ Oct 15 '20 at 12:18
  • Did you tried u to go in the archive of this folder, try to delete it in the archive. As an example: if the file test is in the archive /etc/local/test, then try to delete the folder in cd /etc/local. If it does not work I tried my best to help you.
    – User66
    Oct 15 '20 at 12:35
  • Remotely related to (and definitely nod duplicate of) askubuntu.com/q/1130564/778232 . Oct 17 '20 at 15:08
0

Deleted this file following this tutorial. You would need to boot into your windows system for this

From the tutorial:

Copy and paste the commands given below in the command prompt window and execute the commands one by one.

takeown /F X:\FULL_PATH_TO_FOLDER

takeown /F X:\FULL_PATH_TO_FOLDER /r /d y

icacls X:\FULL_PATH_TO_FOLDER /grant Administrators:F

icacls X:\FULL_PATH_TO_FOLDER /grant Administrators:F /t

I am still intrigued by how I couldn't delete a file even with Sudo and all permissions and whether this is a possible bug in Linux.

Not the answer you're looking for? Browse other questions tagged or ask your own question.