Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have been curious for a long time about software installation in Linux (Ubuntu). Because I am so used to Windows OS, every software is installed by some sort of 'wizard', usually I don't need to configure anything, just click 'next' and that's it, but in Linux world, there are a lot of software need to be build by running some commend, typically, a bunch of .c files. Even I know the structures of the files system of Linux system, but I still don't fully understand where should each file go after a build, for example, some software have executables, and a config file, these two should be located separated somehow. And sometimes, in order to make the executable to be searchable, I can not simple put every thing in my custom folder. I feel strongly that there should be a convention for installing software in Linux box (especially for those need to be build from commend). So, is there a convention? How to make my installed software files well organized, so they are not falling apart.

share|improve this question

closed as too localized by Luis Mar 14 '13 at 16:52

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
It's strange to compare installation of files you compile from source yourself in Linux to an installation wizard in Windows which just installs some binaries. A better comparation would be to where you put programs on Windows if you compiled them from source in Windows (even if that happens less frequently), then you might have to do configuration too. –  N.N. Sep 27 '11 at 6:31

1 Answer 1

All software written in languages like C, C++, Java, C#, etc, needs to be compiled. Whether you use Windows, OS X, Android, iOS, Ubuntu or any other GNU/Linux distro, this is equally true. It doesn't have anything to do with Linux, except that it's more common for people to distribute source code on Linux. In Windows you're usually only allowed to run the program and never will get the .c files, which explains what the program actually does to your system.

If you only get the source code, then that's a sure sign that the software is either extremely specialized or that it isn't meant to be used by casual users, but for developers. Otherwise, you would get a .deb file to double click. You don't need any wizards for that, except if the developers need you to configure it, in which case they will display dialogs.

In any case, the source package should have a build script that will place all the finished files in their right places. It really is quite simple. First you'll run a program to adapt the software to your system. Then you'll compile the software and then you'll install it. This is all automatic. The old way of doing this, is to run something like ./configure; make && sudo make install, but that will install the application outside the package system, which is a bad thing because it won't be uninstallable using the normal tools, and it may conflict with other software you install. So instead you'll use checkinstall to first create a package and then install that package.

So, this is what the process will normally look like:

./configure
make
sudo checkinstall

If you don't want to install the software in the normal places, then you can use ./configure --PREFIX=/some/directory (usually /opt) instead.

This page has detailed information with real examples: https://help.ubuntu.com/community/CompilingSoftware

share|improve this answer

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