2

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?

VedVals
  • 3,471
  • 1
    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 07 '13 at 10:59
  • 1
    What is the reason for preferring /opt for applications that don't normally install there? –  Apr 07 '13 at 11:04
  • 1
    vasa see if this helps. – Salem Apr 07 '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. –  Apr 07 '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 07 '13 at 12:05
  • @handuel There is no need to do it. I merely wondered if it was possible to do so. – VedVals Apr 07 '13 at 14:15

1 Answers1

0

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.

Salem
  • 19,744
  • 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