Monday, October 23, 2017

How to compile and install programs from source

Normally, the project will have a website with instructions for how to build and install it. Google for that first.
For the most part you will do either:
  1. Download a tarball (tar.gz or tar.bz2 file), which is a release of a specific version 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 into the directory created above
  4. run ./configure && make && sudo make install
Or:
  1. Use git or svn or whatever to pull the latest source code from their official source repository
  2. cd into the directory created above
  3. run ./autogen.sh && make && sudo make install
Both configure and autogen.sh will accept a --prefix argument to specify where the software is installed. I recommend checking out Where should I put software I compile myself? for advice on the best place to install custom-built software.

No comments:

Post a Comment