If you really need to remove the directory and other means to do so has failed then just become root and then you can remove it.
rm -rf directory
If you want to keep the directory but change ownership then type
chown -R user:group directory # use the code if you want to change owner and group
chown -R user directory # use the code if you want to change owner only
If you're using a distro like ubuntu or its derivatives, precede the command with sudo
Replace user and group with the desired name and group. The -R
will applied to parent and sub directories within.