Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Some packages, like Adobe Reader and NetBeans, allow installation to /opt folder for global use. However, what should I do to install regular applications to the /opt folder?

Do I have an option to install applications in any folder I want like Windows?

share|improve this question
You can usually choose where to install by using the --prefix option with ./configure. As a rules of thumb though: Files needed for booting go in /bin and /sbin. Files from the distribution go in /usr/bin and /usr/sbin. User maintained files go in /usr/local or /opt. – Hennes Apr 7 '13 at 10:59
What is the reason for preferring /opt for applications that don't normally install there? – user25656 Apr 7 '13 at 11:04
vasa see if this helps. – Salem Apr 7 '13 at 11:27
@Salem, thanks for the link. But I just felt that OP isn't being clear about what is intended and why. – user25656 Apr 7 '13 at 11:45
An application that spreads its different components between /usr/lib /usr/bin /etc and other such folders are still "global". They can be run from any account. /opt is for large "optional" desktop applications. When installing from the software centre the package chooses where to go, and it may not work if you move it, what is the purpose of putting the package in /opt anyway? – w4etwetewtwet Apr 7 '13 at 12:05
up vote 0 down vote accepted

It depends on how the software is packaged.

  • If your software comes with an installer it may let you select where you want to install them;
  • If you are building your software from source, usually you can also select where it will be placed (with --prefix and DESTDIR for configure/make);
  • If you are installing your software from .debs (ie apt-get) you can't choose that. They use / as the "base path".

Regarding the last statement, please note that a .deb is basically a compressed archive with a tree structure similar to the one the package will have when installed, so you can extract them and place whenever you want. But this may or may not work well.

share|improve this answer
It will surely work in 99% of cases if it's documentation. Sometimes doc files can add up to 50 MiB alone, that's why I tend to move them to /opt in order to save space on my /usr. I do this by creating the former folder on /usr as a pseudo-folder, in fact a symlink which points to the documentation in /opt. However: I don't know whether all deinstallation procedures will follow symlinks automatically. apt-get remove probably will not, so you might have to manually remove the folder with the documentation from /opt. – syntaxerror Feb 17 '15 at 20:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.