Introduction

One of the handy features of apt (the packaging system used by Ubuntu) is the use of metapackages. These packages do not contain actual software, they simply depend on other packages to be installed. This setup allows entire sets of software to be installed by selecting only the appropriate metapackage. For example, an Ubuntu user can install the Kubuntu environment (KDE and all its associated programs) by selecting "kubuntu-desktop."

Desktop Metapackages

Ubuntu System Metapackages

Kernel Metapackages

These metapackages install the latest linux kernel and modules through a series of dependencies. These make upgrading the kernel much easier, and safer, since they ensure that all required modules and headers are also installed.

Obsolete kernel packages:

Language Metapackages

Creating Metapackages

A metapackage, such as ubuntu-minimal or ubuntu-desktop, can have a long list of dependencies. So, when a metapackage is automatically removed by the removal or purging of any one, or more, of its underlying dependencies, all of the other packages that were in the metapackage's depends list are still installed on the system. If at a later time, there is an upgrade to the metapackage, the upgrade cannot occur, because the metapackage to be upgraded is no longer installed on the system. However when upgrading to new versions of Ubuntu the update-manager will check to see if you have the meta package installed before attempting to do an upgrade.

It may be possible to create a replacement metapackage to enable an upgrade, but some packages may then need to be removed or purged upon the upgrade of the metapackage. A metapackage which defines some Conflict or Replacement dependencies might be able to stop some of the unwanted packages from being reinstalled. Some trickery is needed.

To create a metapackage, the equivs package can be used. equivs-control creates a template, and after editing, equivs-build will create the deb file. A dpkg -i *.deb command can install the deb package, or you can create a Personal repository as in Personal Repositories to let the package managers like apt-get do the work.

Note: In the control_file template from equivs-control control_file, conditional-OR-dependencies in "Depends:" are separated by '|', not a comma. For example an ubuntu-minimal dependency statement would be:

Depends: adduser, apt, apt-utils, bzip2, console-setup, debconf, dhcp3-client, eject, gnupg, ifupdown, initramfs-tools, iproute, iputils-ping, kbd | kbd-compat, less, libc6-i686, locales, lsb-release, makedev, mawk, module-init-tools, net-tools, netbase, netcat | netcat-openbsd | netcat-traditional, ntpdate, passwd, procps, python, startup-tasks, sudo | sudo-ldap, sysklogd, system-services, tasksel, tzdata, ubuntu-keyring, udev, upstart, upstart-compat-sysv, upstart-logd, vim-tiny, whiptail

This is what you'd see from apt-cache show ubuntu-minimal.


Please see Forums Thread MetaPackages Info & Discussion

MetaPackages (last edited 2019-07-12 16:07:43 by 254C25C7)