An awkward confession and what we should do about it

March 28, 2016

I have an awkward confession.

At this point, we have been running Ubuntu machines for at least nine years or so, starting with Ubuntu 6.06 and moving forward from there. In all of that time, one of the things I haven't done (and I don't think we've done generally) is really dive in and learn about Debian packaging and package management. Oh sure, we can fiddle around with apt-get and a number of other superficial things, we've built modified preseeded install environments, and I've learned enough to modify existing Debian packages and rebuild them. But that's all. That leaves vast oceans of both dpkg and APT usage that we have barely touched, plus all of the additional tools and scripts around the Debian package ecosystem (some of which have been mentioned here by commentators).

I don't have a good explanation for why this has happened, and in particular why I haven't dug into Debian package (because diving into things is one of the things that I do). I can put together theories (including me not being entirely fond of Ubuntu even from the start), but it's all just speculation and if I'm honest it's post-facto excuses and rationalization.

But what it definitely is embarrassing and, in the long run, harmful. There are clearly things in the whole Debian package ecology that would improve our lives if we knew them (for example, I only recently discovered apt-get's --with-new-pkgs option). Yet what I can only describe as my stubborn refusal to dig into Debian packaging is keeping me from this stuff. I need to fix that. I don't necessarily need to know all of the advanced stuff (I may never create a Debian package from scratch), but I should at least understand the big picture and the details that matter to us.

(It should not be the case that I still know much more about RPM and yum/dnf than I do about the Debian equivalents.)

My goal is to be not necessarily an expert but at least honestly knowledgeable, both about the practical nuts and bolts operation of the system and about how everything works conceptually (including such perennial hot topics for me as the principles of the debconf system).

With all of that said, I have to admit that as yet I haven't figured out where I should start reading. Debian has a lot of documentation, but in the past my experience has been that much of it assumes a certain amount of initial context that I don't have yet. Possibly I should start by just reading through all of the APT and dpkg related manpages, trying to sort everything out, and keeping notes about things that I don't understand. Then I can seek further information.

(As is traditional on Wandering Thoughts, I'm writing this partly to spur myself into action.)


Comments on this page:

By dozzie at 2016-03-29 05:52:04:

@cks:

I don't necessarily need to know all of the advanced stuff (I may never create a Debian package from scratch),

This is not that difficult. You need build-essential, debhelper and (two useful things) devscripts and fakeroot packages. Then you create files:

  • debian/compat with "7" or newer (debhelper major version)
  • debian/control (format described in deb-control(5) man page)
  • debian/yourpackage.install with list of files the package should include (dh_install(1))
  • debian/changelog, which is best created with debchange --create -v 0.0.1-1
  • an executable debian/rules with content like this:
#!/usr/bin/make -f
%:
    dh $@

# and maybe:
#override_dh_auto_install:
#    make install DESTDIR=$(CURDIR)/debian/tmp

Debhelper does some magic to detect how it should build the source (./configure, make all, and make install equivalents), but you can override it (dh(1) and dh_auto_**(1)). When overriding dh_auto_install, you should probably use a command similar to the one from the comment in code above.

Other interesting tools to look at: dh_installdirs(1) (empty directories), dh_installdeb(1) (package {pre,post}{install,rm} scripts), dh_installinit(1) (initscripts), dh_installcron(1) (cron entries), dh_installlogrotate(1) (logrotate configs), dh_installman(1) (man pages). Crontab, man pages, and logrotate configs should be fine if simply put with make install equivalent.

Additionally, for building a source package you may want to read dpkg-source(1), especially on what to put in debian/source/format (probably either "3.0 (native)" or "3.0 (quilt)").

By lim at 2016-03-29 22:42:23:

The good part is that it was not necessary in all this time, to dig deeper.

By Ben Hutchings at 2016-03-31 22:53:02:

The Debian New Maintainers' Guide at https://www.debian.org/doc/manuals/maint-guide/ may be a good place to start on packaging.

Written on 28 March 2016.
« Why I don't think upgrading servers would save us much power
My view of Debian's behavior on package upgrades with new dependencies »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Mon Mar 28 22:30:18 2016
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.