Articles tagged with .deb

  1. Debian
    12 Dec 2015
    1. We recently started experimenting with Ansible for automation of multi-step software installations on our servers. Quickly, we realized that Ansible version 1.7.2, which is available through Debian Jessie’s official repositories, doesn’t include all the features we needed. Sadly, the missing recursive option for the acl module is first available in Ansible 2.0, which is not yet fully released. Official packages and Debian Testing packages were only available for Ansible version 1.9.4.

      In the end I decided to investigate how to manually build a Debian package. Here is what I found:

    2. Acquire the source repository

      At first, I cloned the official Git-repository from GitHub:

      cd /usr/local/src
      git clone --recursive https://github.com/ansible/ansible.git

      Then I checked-out the latest 2.0.0 RC tag:

      cd ansible
      git checkout -b v2.0.0-0.7.rc2 tags/v2.0.0-0.7.rc2
      git submodule update
    3. Install build-dependencies

      The mk-build-deps command is part of the devscripts package. The debian make task requires asciidoc to be installed. You can install these like this:

      sudo aptitude install asciidoc devscripts

      To install the development packages necessary to build the Ansible package I generated a temporary package named ansible-build-deps-depends. This temporary package states dependencies on all the packages that are necessary for building the actual Ansible package.

      make DEB_DIST=jessie debian
      mk-build-deps --root-cmd sudo  --install --build-dep deb-build/jessie/ansible-2.0.0/debian/control
      sudo aptitude markauto asciidoc
    4. Build the Ansible package

      To generate the actual .deb file, I issued the following command:

      make DEB_DIST=jessie deb
    5. Install Ansible

      And afterwards I installed the freshly built Ansible .deb package like this:

      sudo gdebi deb-build/jessie/ansible_2.0.0-0.git201512071813.cc98528.headsv20007rc2\~jessie_all.deb

      In case you don’t have gdebi installed, for example if you don’t have a desktop environment running, you can use the following more noisy alternative:

      sudo dpkg -i deb-build/jessie/ansible_2.0.0-0.git201512071813.cc98528.headsv20007rc2\~jessie_all.deb
      sudo apt-get install -f
    6. Remove the build-dependencies again

      After I built the Ansible package I just removed the temporary ansible-build-deps-depends package again. APT will then automatically remove all the development dependencies that it depends upon, leaving a clean system.

      sudo aptitude purge ansible-build-deps-depends