Linux: Compiling and Installing Source Code from the Terminal

From BS Wiki
Revision as of 22:36, 31 May 2021 by Bs (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Method 1, generic

  1. Install the needed dev packages
    For Debian based package management
    sudo apt-get install automake autoconf
    For openSUSE
    sudo zypper install gcc make
  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