2

When installing programs (e.g. openmpi, comsol, lammps) to /usr/local, usually a lot of separate files are created in /usr/local/bin, /usr/local/lib, /usr/local/src etc.

Now when I want to uninstall (e.g. for updating), then finding each relevant file separately would be a madness. Some programs (e.g. openmpi) provide the make uninstall target to do this automatically, but the original makefile might not be available and finding it seems tedious.

Thus, until now I have resorted to building/installing stuff into /opt, where it makes a separate folder for each application and it usually suffices just to delete the folder to uninstall (or make separate folder for a newer version to update).

Of course, when installing to /opt, you have to manually set up paths, but usually this is easy.

Now, what is the appeal to installing to /usr/local compared to /opt? Is there an easy way to uninstall/update programs installed there?

1

Haven't done this for some time, but one way is to use checkinstall which will create a package for your system. After that you can uninstall the package.

  • Interesting, so am I understand this correctly, that one should only install packages using the package manager in /usr/local? And if you want to skip making a package (or the program uses an installer and can't be easily made into a package) then one should install in /opt, right? – eimrek Sep 23 '15 at 13:58
  • @Shepherd well... that's a way to put it. If you want something that you can remove with rm -rf then /opt is your spot. /usr/local is for things that are shared regardless of whether you use a packaging tool or not. E.g. for a compiler or an interpreter or libraries you'll most probably have to pick /usr/local. Same thing for things you need in your path. E.g, installing an alternate python version would better be under /usr/local along with any additional libraries that you install later. – V13 Sep 23 '15 at 21:58
  • @Shepherd additionally, you may have a (e.g.) debian system and use rpm to install packages under /usr/local (or /opt) without interfering with the system's packages. – V13 Sep 23 '15 at 21:59
1

The appeal is not having to setup things like the executable, info, lib and man paths. For graphical apps, you will also most likely have the .desktop file and icons in appropriate places, so they are picked up by your desktop environment.

As for uninstall, knock up a quick uninstall script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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