Lesson 9

Dates: 6/13/2018
Building Linux packages
Linux System Administration

Exercise: Debian/Ubuntu package building.

  • You should have the application files available in directory Project from the exercise with multiple Makefiles. Step into directory Project and re-compile the sources:
    cd Project
  • Create directory tree BUILD/usr/local and copy the compiled files into it:
    mkdir -p BUILD/usr/local
    mkdir  BUILD/usr/local/bin
    mkdir  BUILD/usr/local/lib
    mkdir  BUILD/usr/local/include
    cp Project/bin/app.x BUILD/usr/local/bin
    cp Project/lib/libScalar_Product.a  BUILD/usr/local/lib
    cp Project/include/Scalar_Product.h BUILD/usr/local/include
  • Create subdirectory DEBIAN
    mkdir BUILD/DEBIAN
  • Check the size of the installation tree:
    du -s BUILD/usr/local
  • Create file BUILD/DEBIAN/control with the following content:
    Package: appx
    Priority: optional
    Section: application
    Installed-Size: 32
    Maintainer: Linux class
    Architecture: amd64
    Version: 1.0
    Description: Scalar product of two vectors
  • Build package appx_1.0-0_amd64.deb:
    sudo -s
    cd BUILD/
    chown -R root:root usr/
    dpkg -b . /tmp/appx_1.0-0_amd64.deb
  • Install the newly created package:
    dpkg -i /tmp/appx_1.0-0_amd64.deb
  • Verify that the package has been installed:
    dpkg -l appx

  • Take me to the Course Website