dh_pycentral
Register Python modules with pycentral
SYNOPSIS
dh_pycentral [debhelper options] [--no-scripts]
PARAMETERS
--no-scripts
Skip modifying postinst/prerm scripts; install files only.
-p, --package=PKG
Limit action to package PKG.
-n, --noscripts
Skip script modification entirely.
--no-act
Show actions without executing (dry-run).
-v, --verbose
Verbose operation.
-uPARAM, --uparam=PARAM
Pass parameter to underlying tools.
DESCRIPTION
dh_pycentral is a debhelper program used during Debian package builds for Python modules. It installs .pycentral files—metadata lists of installed Python extensions—into /var/lib/pycentral/.
This enables pycentral, an older system for registering Python modules across multiple interpreter versions. dh_pycentral automatically updates the package's postinst and prerm maintainer scripts to invoke pycentral for registration during install/upgrade and unregistration on removal.
Typically called in debian/rules via dh $(PACKAGE) --with pycentral, it supports multi-binary packages and acts on detected Python modules. However, pycentral is legacy; modern packaging favors dh-python with PEP 3147 site-packages and native extension handling for better multi-version support.
Key use case: legacy pure-Python or extension packages needing central version tracking pre-Python 2.6.
CAVEATS
Deprecated in Debian 11+; pycentral phased out. Use dh-python or dh --with python3 instead. May conflict with modern Python paths.
TYPICAL USAGE
In debian/rules:
dh $@ --with python2,pycentral
Or directly: $(override_dh_auto_install)
python setup.py install ...
dh_pycentral
GENERATED SCRIPTS
Adds to postinst: pycentral pkginstall PACKAGE VERSION
To prerm: pycentral pkgremove PACKAGE VERSION
HISTORY
Added to debhelper ~5.0 (2006) for pycentral support in Ubuntu/Debian Python packaging. Widely used mid-2000s for multi-Python handling. Declined with Python 2 EOL and PEP 3147; deprecated in debhelper 12+ (2019), fully removed in later versions.
SEE ALSO
dh_python2(1), dh-python(1), pycentral(1), debhelper(7), dh_installdirs(1)


