I'd like to be able to create a package that doesnt contain any code or programs itself, but instead installs other packages that exist in the repositories onto a computer, sort of how the ubuntu-restricted-extras package does?

up vote 44 down vote accepted

A meta-package like this can be created with a tool called equivs which will create a package with just dependency information.

First, create a directory:

mkdir my-metapackage
cd my-metapackage/

Now run the program:

equivs-control ns-control

It will create a file called ns-control, open this file with your text editor. The control file that you generate should have its Depends or Recommends lines modified to depend on the packages that you want installed:

Section: misc
Priority: optional
Standards-Version: 3.9.1

Package: my-metapackage
Version: 1.0   
Depends: openssh-server, gedit
Description: This package installes an ssh server and a text editor
 The Long description of this package ends with a newline!

(Just an example, you should include more information)

And finally, build the package by running

equivs-build ns-control

Your package is located at my-metapackage/my-metapackage_1.0_all.deb.

If you wish to also create a source package, the --full option can be passed to equivs-build, e.g. equivs-build --full ns-control. This will use debuild & also create .dsc & .tar.gz files.

To create a source .changes file that you can upload to a PPA, extract & build the source package with

dpkg-source -x my-metapackage_1.0.dsc
cd my-metapackage-1.0
debuild -S

If the Maintainer that you set in ns-control matches your GPG key, it should build & sign the my-metapackage_1.0_source.changes file for you to dput to your PPA

  • Thanks much. I will most likely test this later, but so far, the instructions worked. :) – Thomas Ward Apr 4 '11 at 4:03
  • 2
    It works perfectly! – Stefano Palazzo Apr 4 '11 at 4:09
  • Thanks for the answer, ajmitch, but just because reasons, I"m going to point out that if you have a ~/.devscripts file and specifically define a different GPG key to use in the devscripts file, it will OVERRIDE the dpkg/debuild process and have it use the specific GPG key specified in .devscripts. Just as a noteworthy point for the last sentence in your answer. – Thomas Ward Sep 9 '13 at 17:00
  • I noticed that putting the packages under Depends: makes installation good if and only if packages are there; it doesn't installs them if they're not on my machine. To install them, I used Provides instead and it works like a charm. See my code (just changed it): github.com/palladius/debian-packages/blob/master/… – Riccardo May 18 '17 at 16:44

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.