How to install your 200 favourite programs automatically? Latest versions with bug fixes, please. Create a metapackage.
$ 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”
$ 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.