Linux: Compiling and Installing Source Code from the Terminal

From BS Wiki
Revision as of 14:41, 31 May 2021 by Bs (talk | contribs)
Jump to navigation Jump to search

Method 1, generic

  1. Ensure the automake, autoconf packages are installed, note this first step is only needed on Linux distributions based on Debian.
    sudo apt-get install automake autoconf
  2. Acquire the source code, and untar it if need be. See Linux: Acquiring Source Code
  3. Ensure the root directory and its subdirectories and files have the access permissions set correctly. i.e. not read-only.
  4. Enter the command below from the sources root directory, breaking up the three individual commands if needed.
    sudo ./configure && make && make install

Method 2, Debian based

  1. Install the base compiler toolchain
    sudo apt-get install build-essential devscripts
  2. Acquire the source code, and untar it if need be. See Linux: Acquiring Source Code
  3. Install the build time dependencies
    sudo apt-get build-dep whateverPackage
  4. compile the package
    sudo debuild -us -uc
  5. go up one directory
    cd ..
  6. install the compiled .deb package
    sudo dpkg -i filename.deb