How to write a debian/copyright file. For guidance about what to put in the file, see CopyrightReviewTools. For general packaging information, see Packaging.

Background

A debian/copyright file contains copyright statements for each file in a package. This page discusses one way to write the file. For the formal specification, including alternatives not covered here, see Machine-readable debian/copyright file.

The file consists of one Header stanza that defines general information about the project, one or more Files stanzas that define groups of files with the same copyright information, and one or more License stanzas contain text for each license used in the package.

For real-world examples, see debian/copyright on codesearch.debian.net. A simple example might look like this:

# Header stanza: Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: https://www.example.com/upstream-project-name Upstream-Name: upstream-project-name Upstream-Contact: Upstream Maintainer <maintainer@upstream.com>  # Files stanza: Files: * Copyright: 1975-2025, Upstream Maintainer <maintainer@upstream.com> License: GPL-2.0-only Reference: COPYING 

Write the Header stanza

Start with a Header stanza like this:

Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: https://www.example.com/upstream-project-name Upstream-Name: upstream-project-name Upstream-Contact: Upstream Maintainer <maintainer@upstream.com> #Disclaimer: (this package is non-free/contrib - ... long explanation ...) #License: (general information about the licensing regime) #Copyright: (copyright statement that doesn't apply to any specific file) #Comment ... 
  1. leave Format alone - it must be the same in all debian/copyright files

  2. set Source to the URL of your upstream source

  3. set Upstream-Name to the name of the upstream project

  4. set Upstream-Contact to the name and e-mail address people should use when asking about legal issues

  5. delete Disclaimer if this package goes in the main archive area (most packages), otherwise uncomment it and explain why

  6. uncomment License and/or Copyright in the unlikely event your package has some licensing complexity that isn't otherwise captured, otherwise delete them

  7. delete Comment, or uncomment it and add any other comments

{i} If it's hard to describe your upstream this way, see the specification for alternatives.

Write the Files stanzas

A Files stanza maps a set of files to a copyright statement and a license. Files with the same license but different copyright statements must go in separate stanzas. A simple Files stanza looks like this:

Files: file1  file2  ... Copyright: 1975-2025, Upstream Maintainer <maintainer@upstream.com> License: GPL-2 
  1. use copyright review tools to decide how to group packages

    • this may take a long time, especially if the upstream project doesn't specify the copyright statement at the top of each file
  2. specify one file (e.g. file1) or wildcard (e.g. src/*) per line in Files

  3. copy the Copyright statement from one of the files

  4. put the appropriate short name in License

{i} You can merge the file and license stanza for a license that only appears once.

Write the License stanzas

For each unique License in the Files stanzas, you need a License stanza with the full text of that license. A simple License stanza might look like this:

License: 0BSD  Copyright (C) YEAR by AUTHOR EMAIL  .  Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.  .  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 

If possible, use the short license text in /usr/share/perl5/Software/LicenseMoreUtils/debian-summaries.yml (part of libsoftware-licensemoreutils-perl). Otherwise, include the complete text of your license.

Here are some commands to help generate License stanzas.

# Print short text for `GPL-2.0-or-later`: sed -n \  -e '/^GPL_2/,/^[^ ]/ { s/^ *$/ ./ ; s/{{\$or_later_clause}}/,\n or (at your option) any later version/ ; s/^ */ /p }' \  /usr/share/perl5/Software/LicenseMoreUtils/debian-summaries.yml  # Print short text for `LGPL-2.1-only`: sed -n \  -e '/^LGPL_2_1/,/^[^ ]/ { s/^ *$/ ./ ; s/{{\$or_later_clause}}// ; s/^ */ /p }' \  /usr/share/perl5/Software/LicenseMoreUtils/debian-summaries.yml  # Append your upstream's COPYING file to debian/copyright: sed -e 's/^/ /' -e 's/^ $/ ./' COPYING >> debian/copyright  # Download a copyright statement, reformat it, and put it in your paste buffer: curl https://raw.githubusercontent.com/spdx/license-list-data/main/text/0BSD.txt \  | sed -e 's/^/ /' -e 's/^ $/ ./' \  | xclip 


CategoryPackaging