Compiling source code with Ubuntu

Discussion in 'Linux, BSD and Other OS's' started by RHochstenbach, Jun 19, 2007.

  1. RHochstenbach

    RHochstenbach Administrator Staff Member

    Likes Received:
    Trophy Points:
    As a linux user you might be confronted with the fact that you'll need to compile something because there are no binaries for it. I'll show you how to do it with Ubuntu.

    Run Synaptic Package manager. Search and install the following components:
    - linux-headers (this one is mostly already installed out of the box)
    - build-essential

    Now download the package with the source code. Extract it somewhere, and browse to the folder with the file makefile in it (with the terminal).

    If the file configure is in the same folder, then follow step 1 first, otherwise skip to step 2:

    1. Enter
    2. Enter
    3. Enter
    make install
    4. If there are no errors displayed, then the app should be installed. You may now remove the folder with the source code.
  2. megamaced

    megamaced Geek Geek Geek!

    Likes Received:
    Trophy Points:
    You may want to build a debian package from the source code, which would save you from having to build the source code again. There is a quick and easy way to do this, using a program called "checkinstall"

    You can install it with

    sudo aptitude install checkinstall
    After you have issued "make" to build the source, you then enter:

    sudo checkinstall -D make install
    More information about checkinstall is available here
  3. Addis

    Addis The King

    Likes Received:
    Trophy Points:
    The configure scripts for packages are generated by a program called autoconf, which is part of the autotools build system. This build system was originally developed to solve the problem of creating a self-configuring cross platform build system; instead of using many different Makefiles for different systems.

    However, autotools are not used for everything, and so you may come across packages which use a different system. For example, from KDE4 onwards KDE will be replacing autotools with the CMake build system, which should build packages up to 40% faster than before. For these systems, you'll use a different method and command syntax to compile them.
  4. donkey42

    donkey42 plank

    Likes Received:
    Trophy Points:
    :beer: cheer RH altough i have compiled & installed GNU Parted but i struggle with source code, i'm not looking forward to learning how to edit source code while backporting something

    BTW: you can install from source onto most *nix boxes this way (i think)

    BTW: it looks easy when you see it written down, but when confronted with konsole the palms of my hands start sweating, very scary

    bookmarked, thankies

Share This Page