LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-24-2024, 02:32 PM   #1
DragonspitPublishing.Com
LQ Newbie
 
Registered: Sep 2023
Distribution: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Posts: 16

Rep: Reputation: 0
Taking ownership of folders


I use Linux Mint 21.2 Cinnamon. I'm trying to clean up my system after uninstalling Turboprint.

I used Synaptic Package Manager to delete the package, but got this readout at the end.

(Reading database ... 827268 files and directories currently installed.)
Removing turboprint (2.55-1) ...
Processing triggers for man-db (2.10.2-1) ...
(Reading database ... 825986 files and directories currently installed.)
Purging configuration files for turboprint (2.55-1) ...
dpkg: warning: while removing turboprint, directory '/var/log/turboprint' not empty so not removed
dpkg: warning: while removing turboprint, directory '/usr/share/turboprint/profiles' not empty so not removed
dpkg: warning: while removing turboprint, directory '/etc/turboprint' not empty so not removed


So I located '/var/log/turboprint' and tried to delete it, but my system said I don't have permission because I don't have ownership.

How do I take ownership of the folder so I can get rid of it? I want to permanently delete all three:
'/var/log/turboprint'
'/usr/share/turboprint/profiles'
'/etc/turboprint'

Under Permissions, it says the first is owned by lp, the other two owned by root.

Thanks for any help.
 
Old 03-24-2024, 02:52 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,152

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
remove as root eg
Code:
sudo rm -rf /path/to/folder
 
1 members found this post helpful.
Old 03-25-2024, 11:33 AM   #3
DragonspitPublishing.Com
LQ Newbie
 
Registered: Sep 2023
Distribution: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Keith Hedger View Post
remove as root eg
Code:
sudo rm -rf /path/to/folder
Perfect! Thanks!
 
Old 03-25-2024, 11:50 AM   #4
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554

It should be noted that "sudo rm -rf" is a dangerous command that should be used with care.

Probably running as superuser/root (which is what the sudo does) is enough and the -f (force remove without prompt) is unnecessary.

Using "sudo rm -ri /path/to/remove" makes it interactive - meaning you get a yes/no prompt before each file, and can use Ctrl-C to abort if you accidentally enter an incorrect path.

(Aside: to change ownership, one can use chown command.)

 
Old 03-25-2024, 04:24 PM   #5
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,152

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
I think most rm's ( I read somewhere ) wont do rm -r on / without prompting, but yes any command run as root can be destructive, it's how we learn, I know I have accidently erased / because of carelessness, you only do it once or twice and you learn to back up often!
But the warning is right, I came back to this thread to add such a warning but u beat me to it!
 
  


Reply

Tags
cleanup, spyware, uninstallation



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script to compare folders,Sub-Folders and Sub-Sub-Folders unix_72427 Programming 8 08-08-2012 02:51 PM
Root ownership vs wheel ownership StupidNewbie Linux - Security 2 08-08-2012 12:52 PM
taking ownership of a tty/process Frustin Linux - General 1 04-11-2012 10:48 AM
Users saving but not taking ownership deadtech Other *NIX 4 12-06-2005 10:49 AM
root keeps taking ownership of ~/.Xauthority devfreak Fedora 3 04-07-2005 10:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration