Cannot remove or edit file (even as root) [solved]

While trying to remove the now defunct skype repo from Debian12 I ran into a slight snag, both nano and rm failed to be able to edit the file.

# rm skype-stable.list
rm: cannot remove 'skype-stable.list': Operation not permitted

It turns out that running lsattr showed the immutable attribute (i).

# lsattr skype-stable.list
----i---------e------- skype-stable.list

A quick update to this allowed the file to be removed without issue.

# chattr -i -a skype-stable.list

# lsattr skype-stable.list
--------------e------- skype-stable.list

# rm skype-stable.list

File deleted!

Comments

Popular posts from this blog

Moving a linux (debian12) installation from an old drive to a new one.