I was abstaining from this discussion because I expressed my thoughts on this topic in the past. Deb package format in control file can specify much more fine graded categories of packages this package inter-operate:
- Depends - is a hard dependence on specific package
- Conflicts - is a hard incompatibility with specific package
- Provides - specifies reverse-dependence
- Suggested - packages that are nice-to-have with this package
Here are real use-cases for all them:
- Package
A
needs packageB
to be installed to work properly. In this case when installingA
, packageB
is automatically installed too. But this is only half of the story. In most cases, packageB
is a library about which end user has no idea what it does. So, packageA
is marked asinstalled
while packageB
is marked asinstalled as needed by A
. If user will remove packageA
then packageB
will be removed as well (in case no other package depends on it). - Package
X
implements the very same functionality (and executables) as packageY
, e.g. 2 different versions of the same library (Python 2.7 and Python 3.2 as an example). If package maintainer decides the user only needs eitherX
orY
(to not mix up different versions of the same library during linking) then packageX
may be declared asconflicting with Y
and also packageY
asconflicting with X
. In this case whenX
is installed,Y
is removed automatically after user confirmation and whenY
is installedX
is removed automatically. - We can use meta-packages, which donāt contain any file, but only specify a functionality they are going to provide. This kind of virtual packages always depend on some implementation package. Suppose we have several desktop environments (KDE, Gnome, XFCE, etc). To work properly, they all need some desktop manager. The desktop manager is independent of DE and there are plenty of them (KDM, GDM, XDM, LightDM). So each DE package depends on virtual package
DM
and each *DMprovides DM
. The default implementation ofDM
package may be any of them, sayLightDM
. So when user installsKDE
package, the package manager also pre-selectsDM
package with its default implementationLightDM
. When user installs different DM provider, sayKDM
thenLightDM
is not more necessary and package manager suggests to remove it as no more used. When user removesKDE
, it also removesDM
andKDM
packages. - Suggested packages are not hard dependencies but packages that are installed alongside with given package in most cases, but which can be removed independently. Font packages are good illustration of this use case. When, for package
A
, the suggested package isB
then by selectingA
for installation, the package manager suggests also packageB
, but user is free to not select it, or select some other packageC
with similar functionality. For example CJK fonts are well covered by Code2000 font and also by Noto fonts. If user doesnāt speak any of these languages he is ignorant about what font is better. Still he appreciates that Asian sites he visits show something meaningful. However he prefers to have as little space occupeid by CJK fonts as possible. So while installing an DE, the package manager suggests also installation of Noto fonts (which are nicer than Code2000), the user can choose Code2000 instead (which take less space). When user removes packageA
, the package manager also informs him about packages that were installed as suggested (B
) and gives the option to uninstall them too.