Permissions, conditions and limitations at a glance
Conditions
- License and copyright noticeA copy of the license and the copyright notice must be included when distributing.
- State changesChanges made to the original must be indicated.
- Disclose sourceSource code must be made available when distributing.
- Same licenseModifications and derivatives must be distributed under the same (or a compatible) license.
Limitations
- LiabilityExpressly states that there is no liability for damages.
- WarrantyExpressly states that no warranty is provided.
Permissions, conditions and limitations are classified using data from choosealicense.com (GitHub, MIT License).
What kind of license is it?
GPL-2.0 is the second version of the GPL, published by the FSF in June 1991. Its copyleft principle is the same as GPL-3.0: if you distribute a program that includes or is combined with this code, you must provide the whole under GPL-2.0 with its source. Notable examples are the Linux kernel (GPL-2.0-only, with a syscall exception on some headers), Git (GPL-2.0-only) and WordPress (GPL-2.0-or-later).
only vs or-later
Projects using GPL-2.0 usually pick one of two options.
- GPL-2.0-only: It can only be distributed under the terms of this version. The Linux kernel does this, so it cannot move to GPL-3.0.
- GPL-2.0-or-later: Recipients may choose version 2.0 or any later version published by the FSF (3.0, etc.). The recommended notice in the GPL text uses this form.
Section 9 of the text states that if a program does not specify a version number, any version ever published by the FSF may be chosen. That is why it matters to state clearly which applies in file headers or SPDX identifiers (guide).
What you must do when distributing
- Provide the source code along with it, or with a written offer valid for at least three years (Section 3).
- Retain the copyright notice, warranty disclaimer and a copy of the license (Section 1).
- Mark modified files with a notice of the changes and the date (Section 2a).
- You may not impose further restrictions on recipients' rights (Section 6). If a patent settlement or similar prevents you from complying with the GPL, you may not distribute at all (Section 7).
Common misconceptions
- "GPL-2.0 and GPL-3.0 are both GPL, so they can be mixed" — GPL-2.0-only code and GPL-3.0 code cannot be combined and distributed. One of them must be "or later".
- "Apache-2.0 code can be included too" — The FSF considers Apache-2.0 incompatible with GPL-2.0. An "or later" project can resolve this by distributing under GPL-3.0.
- "There is no patent clause, so I can assert my patents" — There is no express patent grant, but Section 7 and the preamble are intended to prevent distribution that restricts freedom through patents. Interpretations differ, so if patents matter, consider GPL-3.0.
How to apply it
Keep the text unchanged in LICENSE or COPYING and attach the official notice to each file. Keeping the sentence "either version 2 of the License, or (at your option) any later version" in the notice makes it or-later; removing it makes it only. Use the SPDX identifier GPL-2.0-only / GPL-2.0-or-later.
When it fits
It is needed for projects that exchange code with the GPL-2.0-only ecosystem, such as Linux kernel modules. If a new project aims for strong copyleft, GPL-3.0, with its improved patent clause and compatibility, or "GPL-2.0-or-later" is more flexible.
Can GPL-2.0 code go into another project?
General verdicts for taking code released under this license and distributing it combined into a project under each license below. See other combinations in the compatibility checker →
| Target project | Verdict | Notes |
|---|---|---|
| Proprietary (closed-source) software | Not allowed | The entire combined program would have to be released with source under the same GNU license, so it cannot be included while keeping the project's license. |
| MIT | Not allowed | The entire combined program would have to be released with source under the same GNU license, so it cannot be included while keeping the project's license. |
| Apache-2.0 | Not allowed | The entire combined program would have to be released with source under the same GNU license, so it cannot be included while keeping the project's license. |
| MPL-2.0 | Not allowed | The entire combined program would have to be released with source under the same GNU license, so it cannot be included while keeping the project's license. |
| LGPL-2.1 | Allowed with conditions | Because LGPL-2.1 permits conversion to the GPL, this is allowed only if the combined work is distributed under GPL-2.0-only. |
| LGPL-3.0 | Not allowed | GPL-2.0-only code is incompatible with the additional terms of GPL-3.0, LGPL-3.0 and AGPL-3.0. |
| GPL-3.0 | Not allowed | GPL-2.0-only code is incompatible with the additional terms of GPL-3.0, LGPL-3.0 and AGPL-3.0. |
| AGPL-3.0 | Not allowed | GPL-2.0-only code is incompatible with the additional terms of GPL-3.0, LGPL-3.0 and AGPL-3.0. |
The content on this site is general information, not legal advice. For actual distribution, contracts or disputes, consult a lawyer or other qualified professional.