Create deb metapackage in 5 minutes

How to install your 200 favourite programs automatically? Latest versions with bug fixes, please. Create a metapackage.

Install requirements

$ sudo apt-get update
$ sudo apt-get -y install equivs

Create source file

Create a skeleton file. Use only small caps letters [a-z], numbers [0-9] and dash “-” for the name. Use unique, descriptive name.

$ equivs-control teros-ipknow.cfg

Change “Package”, “Version” and “Depends”. Remove comment mark hash “#” from lines you edit.

$ nano teros-ipknow.cfg

Use the same package name as in filename, without the .cfg suffix. You must add to version number every time you make changes. Version number is not a decimal, it is two or three integers separated with a dot (1.2.0<1.10.0).

Depends line lists packages you want to install. Package name must be correct, it should work with apt-get. For example, ‘sudo apt-get install agave’.

My example file looks like this (comments excluded)

 Section: misc
 Priority: optional
 Standards-Version: 3.6.2
 Package: teros-ipknow
 Version: 0.1
 Depends: geoip-bin, gparted
 Description:
 long description and info
 .
 second paragraph

Build your deb package

 $ equivs-build teros-ipknow.cfg

A new package is created.

If build fails, check that you have chosen a package name correctly. Good: “teros-programming”, bad: “Some Metapackage”

Test

 $ sudo gdebi -n teros-ipknow_0.1_all.deb

Your package should install and pull all the dependencies (geoip-bin and gparted).

Congratulations, you have built your first metapackge!

Whenever you install a new computer, you can just install your metapackage. This way, you can have 200 of your favorite programs installed automatically.

Where to go next?

  • Make your package pass ‘lintian’
  • Sign your package
  • Create a repository with ‘reprepro’
  • Create a pre-install or post-install script (don’t overuse these)
  • Automatically answer questions. Even though it’s rare, some packages (mysql-server, sendmail) ask questions. Use debconf-get-selections and debconf-set-selections to automatically answer these questions.
Posted in Uncategorized | Tagged , , , , , , , | 1 Comment

One Response to Create deb metapackage in 5 minutes

  1. Tero Karvinen says:

    A quick example, run on Ubuntu 11.04.

    $ mkdir teros-progs
    $ equivs-control teros-progs.cfg
    $ cat teros-progs.cfg |grep -v ^#|grep -v ‘^$’
    Section: misc
    Priority: optional
    Standards-Version: 3.6.2
    Package: teros-progs
    Version: 0.1
    Maintainer: Tero Karvinen
    Depends: git-core, gcc, vlc, miro, g++
    Description: Metapackage of some of Tero’s favourite progs
    long description and info
    .
    second paragraph
    $ equivs-build teros-progs.cfg
    $
    $ lintian teros-progs_0.1_all.deb # passes lintian check
    $ sudo gdebi -n teros-progs_0.1_all.deb
    $ apt-cache show teros-progs
    $ dpkg –list teros-progs

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Picks

  • Boxing Clock for AndroidOcton8 Diving T-ShirtsShaking Tower Panda Android GameLearn Chinese with Android
  • Student projects