LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-11-2009, 08:10 AM   #1
Debizzle
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Rep: Reputation: 0
No Permission in /OPT


I have a Acer Aspire One, running its standard version of linpus. How do I delete files(programs I've installed via terminal) in the /opt folder. I don't have permission to do it via the file manager.

And more generally... how do I go about deleting any folder that root doesn't have permission to... for example, if someone was to alter the root's 'read and write' permission to 'none' how would I
a)Change it back to 'read and write' or
b)Delete it some other way.

Last edited by Debizzle; 01-11-2009 at 08:18 AM.
 
Old 01-11-2009, 09:10 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
You should be able to change the file permissions on any file as root using the chmod command. It is possible to use the chmod command as root to make a file read only even by root. If you want to later delete or modify that file you have to again use chmod on the file as root to change the permissions before you can delete the file even as root. You can determine the file permissions on any file by running:

# ls -l <file>

If you want to give the owner rwx permissions and all others rx permissions, run:

# chmod 755 <file>

To recursively change the permissions on all files in a given directory run

# chmod -R 755 <directory>

Root should then be able to delete the files or directory.
 
Old 01-11-2009, 10:37 AM   #3
Debizzle
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Original Poster
Rep: Reputation: 0
That worked well on the folder in my documents, I was able to change it back from no permissions and delete it. Thank you.

However it didn't work in /opt. But when I checked the permissions in it says the owner is '1000'. any ideas?

Thanks
 
Old 01-11-2009, 10:51 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
As already stated by kilgoretrout, root should be able to remove any file or directory, despite its permissions (unless some extended attributes are set) and its owner. Even if the file/directory has no permissions at all, like
Code:
d---------  2 root root 4096 Jan 11 17:44 testdir
So the question is: are you sure you're running commands as root? Regarding your original question, if you installed some applications compiling them from source, removing the source directory does not uninstall the application, unless you explicitly installed it under the source directory itself. If you did not issue a make clean or make distclean command in the source directory, you should be able to issue a make uninstall, if the uninstall target is provided by the Makefile. Then you can safely remove the source directory and have the application completely removed.

If the problem is just to change the owner of the directory, use the chown command. For example:
Code:
chown -R root:root /opt/dir
will change recursively the owner and group of /opt/dir, being the name before the colon a valid username and the name after the colon a valid group name to which the user belongs.

Last edited by colucix; 01-11-2009 at 10:55 AM.
 
  


Reply



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
Regarding # /opt/CTEact/bin/act & /opt/SUNWexplo/bin/explorer not available for x86 rajaniyer123 Solaris / OpenSolaris 6 04-24-2008 09:09 AM
permission denied mounting /export/home and /opt/csw xushi Solaris / OpenSolaris 6 07-28-2005 03:45 AM
regarding /opt directory... zameer_india Linux - Newbie 2 01-19-2005 12:48 AM
/opt or /usr ? eeried Linux - Newbie 1 01-06-2005 04:49 AM
Use of /opt monz Linux - General 3 05-13-2004 08:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:19 AM.

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