{"id":120,"date":"2007-11-14T17:07:45","date_gmt":"2007-11-14T07:07:45","guid":{"rendered":"http:\/\/www.erisian.com.au\/wordpress\/?p=120"},"modified":"2007-11-14T17:07:45","modified_gmt":"2007-11-14T07:07:45","slug":"managing-debian-installs","status":"publish","type":"post","link":"https:\/\/www.erisian.com.au\/wordpress\/2007\/11\/14\/managing-debian-installs","title":{"rendered":"Managing Debian Installs"},"content":{"rendered":"<p>For a while I&#8217;ve been trying to find some easy way to keep a few machines I admin behaving the way I want them too with minimal effort. They don&#8217;t really need much maintenance &#8212; but I would like something to help keep them all in sync. Basically, something like FAI, but much, much simpler &#8212; ideally something that takes five minutes to understand, and another five minutes to deploy; and leave the more complicated and powerful tools for when they&#8217;re actually needed.<\/p>\n<p>I figured what I really want was just a simple way to make a meta-package &#8212; one that doesn&#8217;t really provide any functionality, just tells apt\/dpkg what I want installed (via Depends), and what I don&#8217;t want installed (via Conflicts) and adds any extra configuration stuff or local scripts that I decide I want.<\/p>\n<p>But doing that with a real Debian package is harder than I&#8217;m really comfortable with &#8212; I don&#8217;t want to have to worry about potential lintian errors, or rules files and debhelper commands, or writing a Makefile to get my files installed or whatever, I want something more trivial than that. Looking for meta-package creators, the only one I spotted that I thought looked likely was cdd-dev, described as &#8220;Custom Debian Distributions common files for developing meta packages&#8221;. Unfortunately it seems to just provide templates, which makes things quicker, but no less complex.<\/p>\n<p>Fortunately equivs (&#8220;Circumvent Debian package dependencies&#8221;) is actually used for metapackages these days, according to its maintainer on IRC and its long description:<\/p>\n<blockquote>\n<p>This package provides a tool to create Debian packages that only contain dependency information.<\/p>\n<p>One use for this is to create a metapackage: a package whose sole purpose is to declare dependencies and conflicts on other packages so that these will be automatically installed, upgraded, or removed.<\/p>\n<p>Another use is to circumvent dependency checking. [&#8230;]<\/p>\n<\/blockquote>\n<p>That turned out to work much better than I remembered (from whenever I last tried it &#8212; back in &#8217;99 I guess?), with the only drawback being that I couldn&#8217;t add files easily. But that&#8217;s just a matter of creating a patch to equivs, which I then won&#8217;t have to worry about again. So having <a href=\"http:\/\/bugs.debian.org\/cgi-bin\/bugreport.cgi?bug=449542\">done that<\/a>, I can now create a metapackage to do whatever I want by creating a file like:<\/p>\n<blockquote>\n<pre>\nSuite: client\nSection: misc\nPriority: standard\n\nPackage: ajs-client-stuff\nVersion: 20071114.1\nMaintainer: Anthony Towns &lt;aj@erisian.com.au&gt;\nDescription: Metapackage for aj's client computers\n Depends on necessary packages, etc.\n\nFile: \/etc\/apt\/sources.list.d\/client.list\n deb http:\/\/mirror.localnet\/debian etch main contrib non-free\n deb http:\/\/mirror.localnet\/debian etch-proposed-updates main contrib non-free\n .\n deb http:\/\/security.debian.org\/ etch\/updates main contrib non-free\n\nFile: postinst\n #!\/bin\/sh -e\n .\n apt-key add - &lt;&lt;EOF\n <i>[output of gpg --armour --export $KEY]<\/i>\n EOF\n .\n ##DEBHELPER##\n<\/pre>\n<\/blockquote>\n<p>debhelper kindly takes care of getting the permissions right for me, and equivs will generate a full source package if I tell it to, which I can just upload to mini-dinstall and have a regular Debian repository just by writing a text file and running equivs-build. And my metapackage can add dependencies, conflicts, apt sources, cronjobs, scripts, configuration files, documentation, or whatever I happen to want &#8212; which means I can make it automatically update itself, and thus install any dependencies or remove any conflicts, which then means that modifying the config on all the machines is just a matter of updating the metapackage. And new installs is (hopefully) just a matter of doing a standard install and then adding the metapackage. Perfect.<\/p>\n<p>&#8230;even if it is really little more than a reinvention of rpm&#8217;s .spec files. :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a while I&#8217;ve been trying to find some easy way to keep a few machines I admin behaving the way I want them too with minimal effort. They don&#8217;t really need much maintenance &#8212; but I would like something to help keep them all in sync. Basically, something like FAI, but much, much simpler [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.erisian.com.au\/wordpress\/wp-json\/wp\/v2\/posts\/120"}],"collection":[{"href":"https:\/\/www.erisian.com.au\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.erisian.com.au\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.erisian.com.au\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.erisian.com.au\/wordpress\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":0,"href":"https:\/\/www.erisian.com.au\/wordpress\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.erisian.com.au\/wordpress\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.erisian.com.au\/wordpress\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.erisian.com.au\/wordpress\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}