What is the difference between 'contrib' and 'non-free' packages repositories?

non-free packages are packages not complying to the Debian Free Software Guidelines definition. E.g.:

nvidia-driver which provides a proprietary driver.

contrib packages are packages that do comply with the DFSG, but depend on non-free packages, or which depend on some non-free software downloaded (by the package or having to be downloaded manually) to work properly. So they don't end up in main. E.g.:

bumblebee-nvidia which while DFSG compliant, isn't really useful without the non-free package nvidia-driver, so it's put in the contrib section, or

vice which requires to download (while respecting copyrights and laws) ROMs to work properly.

If somebody doesn't want to or can't use non-free software, that person most probably doesn't need or won't be able to use software depending on it, so it's more useful to put them separately in a contrib section. That person won't even have to download the contrib section.

UPDATE: the software in contrib, and its sources are still available for free use. Interesting parts could be reused in an other project, or the non-free (or non available) parts it depends upon could be replaced (e.g.: replace graphics, music etc. assets for a game engine in contrib). Having it separate from non-free helps to know which parts can be reused.

trivia: the Open Source Definition was initially created by removing any mention of Debian in DFSG.


Defined on the Debian Policy Manual:

2.2.2. The contrib archive area

The contrib archive area contains supplemental packages intended to work with the Debian distribution, but which require software outside of the distribution to either build or function.

Every package in contrib must comply with the DFSG.

In addition, the packages in contrib

  • must not be so buggy that we refuse to support them, and

  • must meet all policy requirements presented in this manual.

Examples of packages which would be included in contrib are:

free packages which require contrib, non-free packages or packages which are not in our archive at all for compilation or execution, and

wrapper packages or other sorts of free accessories for non-free programs.

2.2.3. The non-free archive area

The non-free archive area contains supplemental packages intended to work with the Debian distribution that do not comply with the DFSG or have other problems that make their distribution problematic. They may not comply with all of the policy requirements in this manual due to restrictions on modifications or other limitations.

Packages must be placed in non-free if they are not compliant with the DFSG or are encumbered by patents or other legal issues that make their distribution problematic.

In addition, the packages in non-free

  • must not be so buggy that we refuse to support them, and

  • must meet all policy requirements presented in this manual that it is possible for them to meet.

Further reading:

  • Philosophy of the GNU Project

  • Categories of free and nonfree software

  • When Free Software Depends on Nonfree

  • Explaining Why We Don't Endorse Other Systems


https://www.debian.org/doc/debian-policy/ch-archive#s-contrib

The contrib archive area contains supplemental packages intended to work with the Debian distribution, but which require software outside of the distribution to either build or function.

This software could very well be software that is not available in main despite being free. You just can't get it from debian.