EMZETT.
Login

Open-source licences: GPL, MIT and Apache

In short: A licence regulates what you may do with someone else’s source code. The most common free licences differ mainly in whether derived works must also stay free (copyleft) or not.

Permissive licences

You may do almost anything, also use it in closed software. Duty: include the licence text and copyright notice.

  • MIT: very short and simple.
  • BSD (2 or 3 clauses): similar, the third clause forbids advertising with the authors’ names.
  • Apache 2.0: like MIT but with an explicit patent licence and rules for marking changes.

Copyleft licences

Whoever changes and passes on the work must pass it under the same licence and with source code.

  • GPL (v2, v3): strong copyleft. Applies to the whole derived program. The Linux kernel is under GPLv2.
  • LGPL: weaker, mainly for libraries: programs may use the library without having to become free themselves if it stays replaceable.
  • AGPL: like GPL but also applies when the software is only offered over a network (web services).
  • MPL 2.0: copyleft per file.

Other things often confused

  • Public domain / CC0: waiver of rights as far as the law allows.
  • Creative Commons (CC BY, CC BY-SA …) are meant for texts, images, music, not for software.
  • “Open source” is not “free of charge”: you may charge money but must share the source code (for copyleft).
  • Your own code without a licence is not free: without a licence others may not use it.

In practice

Before including a library read the licence and make it compatible with your own. This text is not legal advice. See also Open Source, Copyright and licences for your own projects.

See also: History of Linux and GNU