{
    "mode": "man",
    "parameter": "dpkg-gensymbols",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/dpkg-gensymbols/1/json",
    "generated": "2026-06-03T00:22:52Z",
    "synopsis": "dpkg-gensymbols [option...]",
    "sections": {
        "NAME": {
            "content": "dpkg-gensymbols - generate symbols files (shared library dependency information)\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "dpkg-gensymbols [option...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "dpkg-gensymbols scans a temporary build tree (debian/tmp by default) looking for libraries\nand generates a symbols file describing them. This file, if non-empty, is then installed in\nthe DEBIAN subdirectory of the build tree so that it ends up included in the control\ninformation of the package.\n\nWhen generating those files, it uses as input some symbols files provided by the maintainer.\nIt looks for the following files (and uses the first that is found):\n\n•   debian/package.symbols.arch\n\n•   debian/symbols.arch\n\n•   debian/package.symbols\n\n•   debian/symbols\n\nThe main interest of those files is to provide the minimal version associated to each symbol\nprovided by the libraries. Usually it corresponds to the first version of that package that\nprovided the symbol, but it can be manually incremented by the maintainer if the ABI of the\nsymbol is extended without breaking backwards compatibility. It's the responsibility of the\nmaintainer to keep those files up-to-date and accurate, but dpkg-gensymbols helps with that.\n\nWhen the generated symbols files differ from the maintainer supplied one, dpkg-gensymbols\nwill print a diff between the two versions.  Furthermore if the difference is too\nsignificant, it will even fail (you can customize how much difference you can tolerate, see\nthe -c option).\n",
            "subsections": []
        },
        "MAINTAINING SYMBOLS FILES": {
            "content": "The base interchange format of the symbols file is described in deb-symbols(5), which is used\nby the symbols files included in binary packages. These are generated from template symbols\nfiles with a format based on the former, described in deb-src-symbols(5) and included in\nsource packages.\n\nThe symbols files are really useful only if they reflect the evolution of the package through\nseveral releases. Thus the maintainer has to update them every time that a new symbol is\nadded so that its associated minimal version matches reality.\n\nThe diffs contained in the build logs can be used as a starting point, but the maintainer,\nadditionally, has to make sure that the behaviour of those symbols has not changed in a way\nthat would make anything using those symbols and linking against the new version, stop\nworking with the old version.\n\nIn most cases, the diff applies directly to the debian/package.symbols file. That said,\nfurther tweaks are usually needed: it's recommended for example to drop the Debian revision\nfrom the minimal version so that backports with a lower version number but the same upstream\nversion still satisfy the generated dependencies.  If the Debian revision can't be dropped\nbecause the symbol really got added by the Debian specific change, then one should suffix the\nversion with ‘~’.\n\nBefore applying any patch to the symbols file, the maintainer should double-check that it's\nsane. Public symbols are not supposed to disappear, so the patch should ideally only add new\nlines.\n\nNote that you can put comments in symbols files.\n\nDo not forget to check if old symbol versions need to be increased.  There is no way dpkg-\ngensymbols can warn about this. Blindly applying the diff or assuming there is nothing to\nchange if there is no diff, without checking for such changes, can lead to packages with\nloose dependencies that claim they can work with older packages they cannot work with. This\nwill introduce hard to find bugs with (partial) upgrades.\n",
            "subsections": [
                {
                    "name": "Good library management",
                    "content": "A well-maintained library has the following features:\n\n•   its API is stable (public symbols are never dropped, only new public symbols are added)\nand changes in incompatible ways only when the SONAME changes;\n\n•   ideally, it uses symbol versioning to achieve ABI stability despite internal changes and\nAPI extension;\n\n•   it doesn't export private symbols (such symbols can be tagged optional as workaround).\n\nWhile maintaining the symbols file, it's easy to notice appearance and disappearance of\nsymbols. But it's more difficult to catch incompatible API and ABI change. Thus the\nmaintainer should read thoroughly the upstream changelog looking for cases where the rules of\ngood library management have been broken. If potential problems are discovered, the upstream\nauthor should be notified as an upstream fix is always better than a Debian specific work-\naround.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-P",
                    "content": "Scan package-build-dir instead of debian/tmp.\n",
                    "flag": "-P"
                },
                {
                    "name": "-p",
                    "content": "Define the package name. Required if more than one binary package is listed in\ndebian/control (or if there's no debian/control file).\n",
                    "flag": "-p"
                },
                {
                    "name": "-v",
                    "content": "Define the package version. Defaults to the version extracted from debian/changelog.\nRequired if called outside of a source package tree.\n",
                    "flag": "-v"
                },
                {
                    "name": "-e",
                    "content": "Only analyze libraries explicitly listed instead of finding all public libraries. You can\nuse shell patterns used for pathname expansions (see the File::Glob(3perl) manual page\nfor details) in library-file to match multiple libraries with a single argument\n(otherwise you need multiple -e).\n",
                    "flag": "-e"
                },
                {
                    "name": "-l",
                    "content": "Prepend directory to the list of directories to search for private shared libraries\n(since dpkg 1.19.1). This option can be used multiple times.\n\nNote: Use this option instead of setting LDLIBRARYPATH, as that environment variable is\nused to control the run-time linker and abusing it to set the shared library paths at\nbuild-time can be problematic when cross-compiling for example.\n",
                    "flag": "-l"
                },
                {
                    "name": "-I",
                    "content": "Use filename as reference file to generate the symbols file that is integrated in the\npackage itself.\n",
                    "flag": "-I"
                },
                {
                    "name": "-O",
                    "content": "Print the generated symbols file to standard output or to filename if specified, rather\nthan to debian/tmp/DEBIAN/symbols (or package-build-dir/DEBIAN/symbols if -P was used).\nIf filename is pre-existing, its contents are used as basis for the generated symbols\nfile.  You can use this feature to update a symbols file so that it matches a newer\nupstream version of your library.\n",
                    "flag": "-O"
                },
                {
                    "name": "-t",
                    "content": "symbols(5). The main difference is that in the template mode symbol names and tags are\nwritten in their original form contrary to the post-processed symbol names with tags\nstripped in the compatibility mode.  Moreover, some symbols might be omitted when writing\na standard deb-symbols(5) file (according to the tag processing rules) while all symbols\nare always written to the symbol file template.\n",
                    "flag": "-t"
                },
                {
                    "name": "-c",
                    "content": "Define the checks to do when comparing the generated symbols file with the template file\nused as starting point. By default the level is 1. Increasing levels do more checks and\ninclude all checks of lower levels.\n\nLevel 0\nNever fails.\n\nLevel 1\nFails if some symbols have disappeared.\n\nLevel 2\nFails if some new symbols have been introduced.\n\nLevel 3\nFails if some libraries have disappeared.\n\nLevel 4\nFails if some libraries have been introduced.\n\nThis value can be overridden by the environment variable DPKGGENSYMBOLSCHECKLEVEL.\n",
                    "flag": "-c"
                },
                {
                    "name": "-q",
                    "content": "used as starting point or show any warnings about new/lost libraries or new/lost symbols.\nThis option only disables informational output but not the checks themselves (see -c\noption).\n",
                    "flag": "-q"
                },
                {
                    "name": "-a",
                    "content": "Assume arch as host architecture when processing symbol files. Use this option to\ngenerate a symbol file or diff for any architecture provided its binaries are already\navailable.\n",
                    "flag": "-a"
                },
                {
                    "name": "-d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "-V",
                    "content": "Furthermore in template mode, pattern symbols are followed by comments listing real\nsymbols that have matched the pattern.\n\n-?, --help\nShow the usage message and exit.\n",
                    "flag": "-V"
                },
                {
                    "name": "--version",
                    "content": "Show the version and exit.\n",
                    "long": "--version"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "DPKGGENSYMBOLSCHECKLEVEL\nOverrides the command check level, even if the -c command-line argument was given (note\nthat this goes against the common convention of command-line arguments having precedence\nover environment variables).\n\nDPKGCOLORS\nSets the color mode (since dpkg 1.18.5).  The currently accepted values are: auto\n(default), always and never.\n\nDPKGNLS\nIf set, it will be used to decide whether to activate Native Language Support, also known\nas internationalization (or i18n) support (since dpkg 1.19.0).  The accepted values are:\n0 and 1 (default).\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "<https://people.redhat.com/drepper/symbol-versioning>,\n<https://people.redhat.com/drepper/goodpractice.pdf>,\n<https://people.redhat.com/drepper/dsohowto.pdf>, deb-src-symbol(5), deb-symbols(5), dpkg-\nshlibdeps(1).\n\n\n\n1.21.1                                       2025-09-09                           dpkg-gensymbols(1)",
            "subsections": []
        }
    },
    "summary": "dpkg-gensymbols - generate symbols files (shared library dependency information)",
    "flags": [
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": "Scan package-build-dir instead of debian/tmp."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "Define the package name. Required if more than one binary package is listed in debian/control (or if there's no debian/control file)."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "Define the package version. Defaults to the version extracted from debian/changelog. Required if called outside of a source package tree."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "Only analyze libraries explicitly listed instead of finding all public libraries. You can use shell patterns used for pathname expansions (see the File::Glob(3perl) manual page for details) in library-file to match multiple libraries with a single argument (otherwise you need multiple -e)."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "Prepend directory to the list of directories to search for private shared libraries (since dpkg 1.19.1). This option can be used multiple times. Note: Use this option instead of setting LDLIBRARYPATH, as that environment variable is used to control the run-time linker and abusing it to set the shared library paths at build-time can be problematic when cross-compiling for example."
        },
        {
            "flag": "-I",
            "long": null,
            "arg": null,
            "description": "Use filename as reference file to generate the symbols file that is integrated in the package itself."
        },
        {
            "flag": "-O",
            "long": null,
            "arg": null,
            "description": "Print the generated symbols file to standard output or to filename if specified, rather than to debian/tmp/DEBIAN/symbols (or package-build-dir/DEBIAN/symbols if -P was used). If filename is pre-existing, its contents are used as basis for the generated symbols file. You can use this feature to update a symbols file so that it matches a newer upstream version of your library."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "symbols(5). The main difference is that in the template mode symbol names and tags are written in their original form contrary to the post-processed symbol names with tags stripped in the compatibility mode. Moreover, some symbols might be omitted when writing a standard deb-symbols(5) file (according to the tag processing rules) while all symbols are always written to the symbol file template."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "Define the checks to do when comparing the generated symbols file with the template file used as starting point. By default the level is 1. Increasing levels do more checks and include all checks of lower levels. Level 0 Never fails. Level 1 Fails if some symbols have disappeared. Level 2 Fails if some new symbols have been introduced. Level 3 Fails if some libraries have disappeared. Level 4 Fails if some libraries have been introduced. This value can be overridden by the environment variable DPKGGENSYMBOLSCHECKLEVEL."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "used as starting point or show any warnings about new/lost libraries or new/lost symbols. This option only disables informational output but not the checks themselves (see -c option)."
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "Assume arch as host architecture when processing symbol files. Use this option to generate a symbol file or diff for any architecture provided its binaries are already available."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": "Furthermore in template mode, pattern symbols are followed by comments listing real symbols that have matched the pattern. -?, --help Show the usage message and exit."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Show the version and exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "deb-src-symbol",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/deb-src-symbol/5/json"
        },
        {
            "name": "deb-symbols",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/deb-symbols/5/json"
        },
        {
            "name": "shlibdeps",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/shlibdeps/1/json"
        }
    ]
}