Just how to compile and also install programs from source

This is a concern that actually restricts my satisfaction of Linux. If the application isn't on a database or if it does not have an installer manuscript, after that I actually battle where and also just how to install an application from source.

Fairly to Windows, it's very easy. You're (virtually) called for to make use of an installer application that does every one of the operate in a Wizard. With Linux ... not a lot.

So, do you have any kind of pointers or guidelines on this or exist any kind of internet sites that clearly clarify just how, why and also where to install Linux programs from source?

2019-05-05 01:31:26
Source Share
Answers: 5

A recap for making use of the Ports Collection in FreeBSD:

Find Port

Ports are arranged by group so if you do not recognize what group the port remains in you need to locate it first:

cd /usr/ports
make search name=myport

Sometimes there are way too many access in this way. I directly favor:

find /usr/ports -name myport* -print -depth 2

Use the * when looking given that there are usually numerous variations of a port readily available. The deepness argument guarantees your return outcomes aren't unnecessarily littered with suits you are not likely to desire.


Often, you'll intend to do some arrangement ; software program such as Apache and also Postgres almost need it. There are 3 major selections : command line, setting and also make arrangement documents. To get going with the command line:

make showconfig

this will certainly detail the default arrangement alternatives. If you like the defaults you prepare to compile and also install. Otherwise,

make config

will certainly raise a dialog box where you can select which alternatives you desire. (Don't come to be perplexed with this and also make configure which configures your port with your picked alternatives!) This is usually enough but also for some software program, like Apache, there is usually intricate arrangement that a straightforward dialog will not take care of. For this, you additionally need to consider the Makefile (s) which will certainly occasionally offer you some added targets for make that will certainly offer you even more details. To proceed the Apache instance

make show-modules
make show-options
make show-categories

will certainly offer you details on establishing you picked components, string alternatives and so on. If your port's defaults are primarily great and also you simply intend to transform a couple of points, you can additionally simply pass key = value sets like setting variables:

make MYVBL1=MYVAL1 ... install clean

Also, you can set button alternatives using the -D alternative:

make -D MYVAR -D MYOTHERVAR ... install clean

For intricate arrangement nonetheless the command line will not function well and also you're far better neither of the first 2 approaches will certainly work. In this instance you can make an arrangement documents and also pass that to make with the __ MAKE_CONF variable. FreeBSD has a default arrangement documents : /etc/make.conf which generally has details on formerly mounted ports and also various other system setups. To begin, create a documents with your ports alternatives, call it ~/myport.mk and afterwards incorporate that documents with/ etc/make. conf:

cat /etc/make.conf ~/myport.mk >> ~/make.myport.conf

you can after that check your arrangement:

make showconfig __MAKE_CONF=~/make.port.conf

and also if every little thing looks excellent:

make install clean __MAKE_CONF=~/make.myport.conf

BEWARE! If you require to readjust your arrangement setups after make configure or an installment in entire or component you definitely have to clear your arrangement first :

make rmconfig

Failure to do so will certainly cause unanticipated communications in between the ports subsystem, your port's make defaults and also your wanted arrangement.

That's sort of a whole lot for a recap, yet the intricacy of arrangement is primarily concerning the application, not the port. Slam as an example, does not actually have any kind of alternatives.


This is the very easy component:

make install clean

or you can

make build
make install
make clean

which is simply extra keying.

That's virtually it. Clearly there is even more you can do such as recursively detailing dependences and also arrangement alternatives, upgrade with spots and more. Below I will certainly refer you to the Ports area of the Handbook, the port subsystem's male web page (excellent details on added make targets) and also the make male web page.

2019-05-09 00:54:44

I assume it's simply best to read the documents featuring that details program or application that you're intending to install. Generally there are readmes/READMEs inside the tarballs (the application source archive which you can generally download and install) or perhaps even INSTALL documents to read and also learn more about what is the recommended means of mounting claimed application. Basically : RTFM ;)

2019-05-08 12:23:56

Recently I've begun making use of "Checkinstall" when mounting from source beyond my plan supervisor. It constructs a "plan" from a 3rd event tarball which can after that be mounted and also taken care of (and also uninstalled) via your plan supervisor devices.

Look into this write-up - http://www.linuxjournal.com/content/using-checkinstall-build-packages-source

2019-05-08 12:16:58

Normally, the task will certainly have an internet site with guidelines for just how to construct and also install it. Google for that first.

Essentially you will certainly do either :

  1. Download a tarball (tar.gz or tar.bz2 documents), which is a release of a details variation of the source code
  2. Extract the tarball with a command like tar zxvf myapp.tar.gz for a gzipped tarball or tar jxvf myapp.tar.bz2 for a bzipped tarball
  3. cd right into the directory developed over
  4. run ./configure && make && sudo make install

Or :

  1. Use git or svn or whatever to draw the most up to date source code from their main source database
  2. cd right into the directory developed over
  3. run ./autogen.sh && make && sudo make install

Both configure and also autogen.sh will certainly approve a - - prefix argument to define where the software program is mounted. I advise looking into Where should I put software I compile myself? for suggestions on the most effective area to install personalized - constructed software program.

2019-05-08 07:30:29

I simply intend to add that there are plan supervisors that compile plans from source, and also take care of all plan dependences, flags, and so on

. In BSD systems it's ports : Using the Ports Collection

In Debian, the apt-get plan supervisor can install from source also : APT HOWTO: Working with source packages (Same goes with Ubuntu, Linux - mint and also every little thing else based upon Debian)

The Gentoo circulation makes use of the portage plan supervisor, which assembles the entire system from source just : Portage Introduction.

Slackware can compile plans yet I do not recognize if there's any kind of plan supervisor for this therein. =)

Anyway you can constantly compile plans by hand like Sandy stated over =) Also it have to be feasible to make use of apt-get or portage plan supervisors in any kind of various other distro ...

2019-05-08 06:17:52