Understanding the Error
Operation not permitted
rm: cannot remove "file": Operation not permitted
Common Causes
1. Immutable Flag Set
lsattr file
sudo chattr -i file
rm file
2. Append-Only Flag
lsattr file
sudo chattr -a file
3. Permission Issue
ls -la file
sudo chown user:user file
sudo chmod 755 file
4. noexec Mount Option
mount | grep noexec
sudo mount -o remount,exec /mountpoint
5. NFS Root Squash
cat /etc/exports
6. SELinux Blocking
sudo grep "denied" /var/log/audit/audit.log
sudo setenforce 0
Fix Commands
sudo rm -rf file
sudo command