Take Ownership of Locked Files in Ubuntu

I recently installed a program through dpkg and then removed it with the dpkg -r command. However, I encountered some issues with folder permissions. The program I installed also created a security group which my username was not a part of. To take ownership of the files and remove them, I issued these commands:
  • Navigate to the directory above the locked directories.
  • chown -hR username /foldername
This changed the ownership of the folder and subfolders to my username, thus allowing me to remove the files.
*Note: If you are not logged in as root, then you will use the sudo prefix.

1 comments:

  Anonymous

June 2, 2011 at 5:37 PM

Open Nautilus as root and you should be able to delete them. Open terminal and type sudo nautilus. Then just navigate to the folders or files that you want to delete.