1830900 Members
3266 Online
110017 Solutions
New Discussion

files in /opt

 
Mark Vollmers
Esteemed Contributor

files in /opt

Hi, all. I've got a question about what files are in /opt. I am trying to clean up the system a bit, and I noticed that if I cd to /opt and ls, there are a bunch of programs that are installed elsewhere. For example, I have xfishtank on the server (neat little program, I might add) that I installed in /home/apps/xfishtank. I find what appears to be a full copy of the program in /opt/xfishtank. What's going on here? Can I delete the copy in /opt, since I run it from /home and I have a ton more space in /home? It appears that a number of programs are copied here in /opt, but not everything. What's the rational for this? I'd like to get rid of them if possible, since that will help free up space. Thanks, everyone.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
5 REPLIES 5
John Poff
Honored Contributor

Re: files in /opt

Mark,

The /opt filesystem is supposed to contain installed software. I lean towards having the software in /opt instead of in /home, unless it is a piece of software that nobody else will run. Having the software in /opt gives you a little more security and control over the installed software.

I have a development box here where one of the developers has installed a copy of xemacs in his home directory. At some point I'll probably install a real copy in /opt and have him get rid of his personal copy. That way, I can control it and other people can use it if they need to.

JP
Curt Thompson
Respected Contributor

Re: files in /opt

Hello Mark,

Before you delete one of those 'copies', are you sure one of them is not a symbolic link of the other? Just checking...

Good Luck,
Curt
Jim Turner
HPE Pro

Re: files in /opt

Mark,

As the others have stated, /opt is for OPTional software products. If you install a product named "foo" for example, you would usually see the following:

/opt/foo # dir tree for exe's and lib's
/etc/opt/foo # dir tree for foo config files
/var/opt/foo # dir tree for foo log and spool files

You might wind up with /home/yourdir/foo, but you'll probably find it to be a sym link to the exe something like so:
foo -> /opt/foo/bin/foobinary

You can swremove products that are no longer needed to free up space in /opt. A handy little command I use to see who's soaking up filesystem space (/opt for example) is as follows:
du -kx /opt | sort -rn | more

This will give you a highest-to-lowest list of filesystem usage in KB (not blocks).

Cheers,
Jim
Mark Vollmers
Esteemed Contributor

Re: files in /opt

Thanks for the replys so far. Looking at everyhting, it seems that the copies that I have are not links but actual files. Some of what is in /opt is in swlist, but some a few programs are not, and there is a bunch of stuff in there that is not in swlist. What I wonder is why, when I swinstall and set the target directory to, say, /home/apps, does it put a second copy in /opt? Is the one in /opt required for the one in /home/apps to run? If I run swremove for these, which copy will it take? I am not concerned with control of the these particular programs (as far as security is concerned).
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Ravi_8
Honored Contributor

Re: files in /opt

hi,
some of the softwares installed by default get installed under /opt(like IBM's MQseris)and some patches like trace when installed, will get installed in some other place but a piece of the software will be stored in /opt(like man,which is optional which if you don't want can be removed)
never give up