Virtual packages (a.k.a meta packages) are not real packages but they are highly used. By installing a virtual package you can force debian based systems to install all dependent packages and you get rid of installing/removing packages you want or dont want. Additionally, you can group some independent packages so you can install them by easily.
Beriefly, use cases are alot for virtual packages. Apt mechanism in debian systems depends on control files of packages. You can get information from this link about control files. After you learn every field and its function in control file, you can use virtual packages for many things.
You can create virtual packages by learning how to create debian packages but there is a tool called equivs which makes life easier.
Firstly you install equivs if you dont have
apt-get install equivs
Find a name for your new package and run this command, i.e. ozanh-dev-env
equivs-control ozanh-dev-env
The above command creates a control file in the directory you are in
The content of the control file is below
### Commented entries have reasonable defaults. ### Uncomment to edit them. # Source: <source package name; defaults to package name> Section: misc Priority: optional # Homepage: <enter URL here; no default> Standards-Version: 3.9.2 Package: <package name; defaults to equivs-dummy> # Version: <enter version here; defaults to 1.0> # Maintainer: Your Name <[email protected]> # Pre-Depends: <comma-separated list of packages> # Depends: <comma-separated list of packages> # Recommends: <comma-separated list of packages> # Suggests: <comma-separated list of packages> # Provides: <comma-separated list of packages> # Replaces: <comma-separated list of packages> # Architecture: all # Copyright: <copyright file; defaults to GPL2> # Changelog: <changelog file; defaults to a generic changelog> # Readme: <README.Debian file; defaults to a generic one> # Extra-Files: <comma-separated list of additional files for the doc directory> # Files: <pair of space-separated paths; First is file to include, second is destination> # <more pairs, if there's more than one file to include. Notice the starting space> Description: <short description; defaults to some wise words> long description and info . second paragraph
I edited the control file for my needs and became like this
### Commented entries have reasonable defaults. ### Uncomment to edit them. # Source: <source package name; defaults to package name> Section: misc Priority: optional Homepage: http://www.ozanh.com Standards-Version: 3.9.2 Package: ozanh-dev-env Version: 1.0-1 Maintainer: Ozan H. <ozan_haci@yahoo.com> # Pre-Depends: <comma-separated list of packages> Depends: python-dev, cython, python-numpy, python-stdeb, python-setuptools, build-essential, simple-cdd, approx, lintian # Recommends: <comma-separated list of packages> # Suggests: <comma-separated list of packages> # Provides: <comma-separated list of packages> # Replaces: <comma-separated list of packages> Architecture: all # Copyright: <copyright file; defaults to GPL2> # Changelog: <changelog file; defaults to a generic changelog> # Readme: <README.Debian file; defaults to a generic one> # Extra-Files: <comma-separated list of additional files for the doc directory> # Files: <pair of space-separated paths; First is file to include, second is destination> # <more pairs, if there's more than one file to include. Notice the starting space> Description: <short description; defaults to some wise words> long description and info . second paragraph
Then you run the following command
equivs-build ozanh-dev-env
Your new deb package is ready in the same directory and you can install it with
dpkg -i ozanh-dev-env_1.0-1_all.deb apt-get install -f
You can check the quality of the deb package by
lintian ozanh-dev-env_1.0-1_all.deb
Have fun…
Discussion