Command-line Reference
This page documents the command-line flags available in FPM. You can also see this content in your terminal by running fpm --help
General Options
-C CHDIRAlternate option spellings:
--chdirChange directory to here before searching for files
-S PACKAGE_NAME_SUFFIXAlternate option spellings:
--package-name-suffixa name suffix to append to package and dependencies.
-a ARCHITECTUREAlternate option spellings:
--architectureThe architecture name. Usually matches ‘uname -m’. For automatic values, you can use ‘-a all’ or ‘-a native’. These two strings will be translated into the correct value for your platform and target package type.
-d DEPENDENCYAlternate option spellings:
--dependsA dependency. This flag can be specified multiple times. Value is usually in the form of: -d ‘name’ or -d ‘name > version’
-eAlternate option spellings:
--editEdit the package spec before building.
-fAlternate option spellings:
--forceForce output even if it will overwrite an existing file
-m MAINTAINERAlternate option spellings:
--maintainerThe maintainer of this package.
-n NAMEAlternate option spellings:
--nameThe name to give to the package
-p OUTPUTAlternate option spellings:
--packageThe package file path to output.
-s INPUT_TYPEAlternate option spellings:
--input-typethe package type to use as input (gem, rpm, python, etc)
-t OUTPUT_TYPEAlternate option spellings:
--output-typethe type of package you want to create (deb, rpm, solaris, etc)
-v VERSIONAlternate option spellings:
--versionThe version to give to the package
-x EXCLUDE_PATTERNAlternate option spellings:
--excludeExclude paths matching pattern (shell wildcard globs valid here). If you have multiple file patterns to exclude, specify this flag multiple times.
--after-install FILEA script to be run after package installation
--after-remove FILEA script to be run after package removal
--after-upgrade FILEA script to be run after package upgrade. If not specified, –before-install, –after-install, –before-remove, and –after-remove will behave in a backwards-compatible manner (they will not be upgrade-case aware). Currently only supports deb, rpm and pacman packages.
--before-install FILEA script to be run before package installation
--before-remove FILEA script to be run before package removal
--before-upgrade FILEA script to be run before package upgrade. If not specified, –before-install, –after-install, –before-remove, and –after-remove will behave in a backwards-compatible manner (they will not be upgrade-case aware). Currently only supports deb, rpm and pacman packages.
--category CATEGORY(optional) category this package belongs to
--config-files CONFIG_FILESMark a file in the package as being a config file. This uses ‘conffiles’ in debs and %config in rpm. If you have multiple files to mark as configuration files, specify this flag multiple times. If argument is directory all files inside it will be recursively marked as config files.
--conflicts CONFLICTSOther packages/versions this package conflicts with. This flag can be specified multiple times.
--debugEnable debug output
--debug-workspaceKeep any file workspaces around for debugging. This will disable automatic cleanup of package staging and build paths. It will also print which directories are available.
--description DESCRIPTIONAdd a description for this package. You can include ‘n’ sequences to indicate newline breaks.
--directories DIRECTORIESRecursively mark a directory as being owned by the package. Use this flag multiple times if you have multiple directories and they are not under the same parent directory
--epoch EPOCHThe epoch value for this package. RPM and Debian calls this ‘epoch’. FreeBSD calls this ‘PORTEPOCH’
--exclude-file EXCLUDE_PATHThe path to a file containing a newline-sparated list of patterns to exclude from input.
--fpm-options-file FPM_OPTIONS_FILEA file that contains additional fpm options. Any fpm flag format is valid in this file. This can be useful on build servers where you want to use a common configuration or inject other parameters from a file instead of from a command-line flag..
--inputs INPUTS_PATHThe path to a file containing a newline-separated list of files and dirs to use as input.
--iteration ITERATIONThe iteration to give to the package. RPM calls this the ‘release’. FreeBSD calls it ‘PORTREVISION’. Debian calls this ‘debian_revision’
--license LICENSE(optional) license name for this package
--log LEVELSet the log level. Values: error, warn, info, debug.
--no-auto-dependsDo not list any dependencies in this package automatically
--no-dependsDo not list any dependencies in this package
--post-install FILE(DEPRECATED, use –after-install) A script to be run after package installation
--post-uninstall FILE(DEPRECATED, use –after-remove) A script to be run after package removal
--pre-install FILE(DEPRECATED, use –before-install) A script to be run before package installation
--pre-uninstall FILE(DEPRECATED, use –before-remove) A script to be run before package removal
--prefix PREFIXA path to prefix files with when building the target package. This may not be necessary for all input packages. For example, the ‘gem’ type will prefix with your gem directory automatically.
--provides PROVIDESWhat this package provides (usually a name). This flag can be specified multiple times.
--replaces REPLACESOther packages/versions this package replaces. Equivalent of rpm’s ‘Obsoletes’. This flag can be specified multiple times.
--source-date-epoch-default SOURCE_DATE_EPOCH_DEFAULTIf no release date otherwise specified, use this value as timestamp on generated files to reduce nondeterminism. Reproducible build environments such as dpkg-dev and rpmbuild set this via envionment variable SOURCE_DATE_EPOCH variable to the integer unix timestamp to use in generated archives, and expect tools like fpm to use it as a hint to avoid nondeterministic output. This is a Unix timestamp, i.e. number of seconds since 1 Jan 1970 UTC. See https://reproducible-builds.org/specs/source-date-epoch
--source-date-epoch-from-changelogUse release date from changelog as timestamp on generated files to reduce nondeterminism. Experimental; only implemented for gem so far.
--template-scriptsAllow scripts to be templated. This lets you use ERB to template your packaging scripts (for –after-install, etc). For example, you can do things like <%= name %> to get the package name. For more information, see the fpm wiki: https://github.com/jordansissel/fpm/wiki/Script-Templates
--template-value KEY=VALUEMake ‘key’ available in script templates, so <%= key %> given will be the provided value. Implies –template-scripts
--url URIAdd a url for this package.
--vendor VENDOR(optional) vendor name for this package
--verboseEnable verbose output
--workdir WORKDIRThe directory you want fpm to do its work in, where ‘work’ is any file copying, downloading, etc. Roughly any scratch space fpm needs to build your package.
apk
This package type has no additional options
cpan
--cpan-cpanm-bin CPANM_EXECUTABLEThe path to the cpanm executable you wish to run.
--[no-]cpan-cpanm-forcePass the –force parameter to cpanm
--cpan-mirror CPAN_MIRRORThe CPAN mirror to use instead of the default.
--[no-]cpan-mirror-onlyOnly use the specified mirror for metadata.
--cpan-package-name-prefix NAME_PREFIXName to prefix the package name with.
--cpan-perl-bin PERL_EXECUTABLEThe path to the perl executable you wish to run.
--cpan-perl-lib-path PERL_LIB_PATHPath of target Perl Libraries
--[no-]cpan-sandbox-non-coreSandbox all non-core modules, even if they’re already installed
--[no-]cpan-testRun the tests before packaging?
--[no-]cpan-verboseProduce verbose output from cpanm?
deb
--deb-activate EVENTPackage activates EVENT trigger
--deb-activate-noawait EVENTPackage activates EVENT trigger
--deb-after-purge FILEA script to be run after package removal to purge remaining (config) files (a.k.a. postrm purge within apt-get purge)
--[no-]deb-auto-config-filesInit script and default configuration files will be labeled as configuration files for Debian packages.
--deb-build-depends DEPENDENCYAdd DEPENDENCY as a Build-Depends
--deb-changelog FILEPATHAdd FILEPATH as debian changelog
--deb-compression COMPRESSIONThe compression type to use, must be one of gz, bzip2, xz, zst, none.
--deb-compression-level [0-9]Select a compression level. 0 is none or minimal. 9 is max compression.
--deb-config SCRIPTPATHAdd SCRIPTPATH as debconf config file.
--deb-custom-control FILEPATHCustom version of the Debian control file.
--deb-default FILEPATHAdd FILEPATH as /etc/default configuration
--deb-dist DIST-TAGSet the deb distribution.
--deb-field 'FIELD: VALUE'Add custom field to the control file
--[no-]deb-generate-changesGenerate PACKAGENAME.changes file.
--deb-group GROUPThe group owner of files in this package
--[no-]deb-ignore-iteration-in-dependenciesFor ‘=’ (equal) dependencies, allow iterations on the specified version. Default is to be specific. This option allows the same version of a package but any iteration is permitted
--deb-init FILEPATHAdd FILEPATH as an init script
--deb-installed-size KILOBYTESThe installed size, in kilobytes. If omitted, this will be calculated automatically
--deb-interest EVENTPackage is interested in EVENT trigger
--deb-interest-noawait EVENTPackage is interested in EVENT trigger without awaiting
--[no-]deb-maintainerscripts-force-errorchecksActivate errexit shell option according to lintian. https://lintian.debian.org/tags/maintainer-script-ignores-errors.html
--deb-meta-file FILEPATHAdd FILEPATH to DEBIAN directory
--[no-]deb-no-default-config-filesDo not add all files in /etc as configuration files by default for Debian packages.
--deb-pre-depends DEPENDENCYAdd DEPENDENCY as a Pre-Depends
--deb-priority PRIORITYThe debian package ‘priority’ value.
--deb-recommends PACKAGEAdd PACKAGE to Recommends
--deb-shlibs SHLIBSInclude control/shlibs content. This flag expects a string that is used as the contents of the shlibs file. See the following url for a description of this file and its format: http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-shlibs
--deb-suggests PACKAGEAdd PACKAGE to Suggests
--deb-systemd FILEPATHAdd FILEPATH as a systemd script
--[no-]deb-systemd-auto-startStart service after install or upgrade
--[no-]deb-systemd-enableEnable service on install or upgrade
--deb-systemd-path FILEPATHRelative path to the systemd service directory
--[no-]deb-systemd-restart-after-upgradeRestart service after upgrade
--deb-templates FILEPATHAdd FILEPATH as debconf templates file.
--deb-upstart FILEPATHAdd FILEPATH as an upstart script
--deb-upstream-changelog FILEPATHAdd FILEPATH as upstream changelog
--[no-]deb-use-file-permissionsUse existing file permissions when defining ownership and modes
--deb-user USERThe owner of files in this package
dir
This package type has no additional options
empty
This package type has no additional options
freebsd
--freebsd-origin ABISets the FreeBSD ‘origin’ pkg field
--freebsd-osversion VERSIONSets the FreeBSD ‘version’ pkg field, ie 12 or 13, use ‘*’ for all.
gem
--gem-bin-path DIRECTORYThe directory to install gem executables
--gem-disable-dependency gem_nameThe gem name to remove from dependency list
--[no-]gem-embed-dependenciesShould the gem dependencies be installed?
--[no-]gem-env-shebangShould the target package have the shebang rewritten to use env?
--[no-]gem-fix-dependenciesShould the package dependencies be prefixed?
--[no-]gem-fix-nameShould the target package name be prefixed?
--gem-gem PATH_TO_GEMThe path to the ‘gem’ tool (defaults to ‘gem’ and searches your $PATH)
--gem-git-branch GIT_BRANCHWhen using a git repo as the source of the gem instead of rubygems.org, use this git branch.
--gem-git-repo GIT_REPOUse this git repo address as the source of the gem instead of rubygems.org.
--gem-package-name-prefix PREFIXName to prefix the package name with.
--gem-package-prefix NAMEPREFIX(DEPRECATED, use –package-name-prefix) Name to prefix the package name with.
--[no-]gem-prereleaseAllow prerelease versions of a gem
--gem-shebang SHEBANGReplace the shebang in the executables in the bin path with a custom string
--gem-stagingdir STAGINGDIRThe directory where fpm installs the gem temporarily before conversion. Normally a random subdirectory of workdir.
--[no-]gem-version-binsAppend the version to the bins
npm
--npm-bin NPM_EXECUTABLEThe path to the npm executable you wish to run.
--npm-package-name-prefix PREFIXName to prefix the package name with.
--npm-registry NPM_REGISTRYThe npm registry to use instead of the default.
osxpkg
--osxpkg-dont-obsolete DONT_OBSOLETE_PATHA file path for which to ‘dont-obsolete’ in the built PackageInfo. Can be specified multiple times.
--osxpkg-identifier-prefix IDENTIFIER_PREFIXReverse domain prefix prepended to package identifier, ie. ‘org.great.my’. If this is omitted, the identifer will be the package name.
--osxpkg-ownership OWNERSHIP–ownership option passed to pkgbuild. Defaults to ‘recommended’. See pkgbuild(1).
--[no-]osxpkg-payload-freeDefine no payload, assumes use of script options.
--osxpkg-postinstall-action POSTINSTALL_ACTIONPost-install action provided in package metadata. Optionally one of ‘logout’, ‘restart’, ‘shutdown’.
p5p
--p5p-group GROUPSet the group to GROUP in the prototype file.
--[no-]p5p-lintCheck manifest with pkglint
--p5p-publisher PUBLISHERSet the publisher name for the repository
--p5p-user USERSet the user to USER in the prototype files.
--[no-]p5p-validateValidate with pkg install
--p5p-zonetype ZONETYPESet the allowed zone types (global, nonglobal, both)
pacman
--pacman-compression COMPRESSIONThe compression type to use, must be one of gz, bzip2, xz, zstd, none.
--pacman-group GROUPThe group owner of files in this package
--pacman-optional-depends PACKAGEAdd an optional dependency to the pacman package.
--[no-]pacman-use-file-permissionsUse existing file permissions when defining ownership and modes
--pacman-user USERThe owner of files in this package
pear
--pear-bin-dir BIN_DIRDirectory to put binaries in
--pear-channel CHANNEL_URLThe pear channel url to use instead of the default.
--[no-]pear-channel-updatecall ‘pear channel-update’ prior to installation
--pear-data-dir DATA_DIRSpecify php dir relative to prefix if differs from pear default (pear/data)
--pear-package-name-prefix PREFIXName prefix for pear package
--pear-php-bin PHP_BINSpecify php executable path if differs from the os used for packaging
--pear-php-dir PHP_DIRSpecify php dir relative to prefix if differs from pear default (pear/php)
pkgin
This package type has no additional options
pleaserun
--pleaserun-chdir CHDIRThe working directory used by the service
--pleaserun-name SERVICE_NAMEThe name of the service you are creating
--pleaserun-user USERThe user to use for executing this program.
puppet
This package type has no additional options
python
--python-bin PYTHON_EXECUTABLEThe path to the python executable you wish to run.
--[no-]python-dependenciesInclude requirements defined by the python package as dependencies.
--python-disable-dependency python_package_nameThe python package name to remove from dependency list
--[no-]python-downcase-dependenciesShould the package dependencies be in lowercase?
--[no-]python-downcase-nameShould the target package name be in lowercase?
--python-easyinstall EASYINSTALL_EXECUTABLEThe path to the easy_install executable tool
--[no-]python-fix-dependenciesShould the package dependencies be prefixed?
--[no-]python-fix-nameShould the target package name be prefixed?
--python-install-bin BIN_PATH(DEPRECATED, does nothing) The path to where python scripts should be installed to.
--python-install-data DATA_PATH(DEPRECATED, does nothing) The path to where data should be installed to. This is equivalent to ‘python setup.py –install-data DATA_PATH
--python-install-lib LIB_PATH(DEPRECATED, does nothing) The path to where python libs should be installed to (default depends on your python installation). Want to find out what your target platform is using? Run this: python -c ‘from distutils.sysconfig import get_python_lib; print get_python_lib()’
--[no-]python-internal-pipUse the pip module within python to install modules - aka ‘python -m pip’. This is the recommended usage since Python 3.4 (2014) instead of invoking the ‘pip’ script
--[no-]python-obey-requirements-txtUse a requirements.txt file in the top-level directory of the python package for dependency detection.
--python-package-name-prefix PREFIXName to prefix the package name with.
--python-package-prefix NAMEPREFIX(DEPRECATED, use –package-name-prefix) Name to prefix the package name with.
--python-pip PIP_EXECUTABLEThe path to the pip executable tool. If not specified, easy_install is used instead
--python-pypi PYPI_URLPyPi Server uri for retrieving packages.
--python-scripts-executable PYTHON_EXECUTABLE(DEPRECATED) Set custom python interpreter in installing scripts. By default distutils will replace python interpreter in installing scripts (specified by shebang) with current python interpreter (sys.executable). This option is equivalent to appending ‘build_scripts –executable PYTHON_EXECUTABLE’ arguments to ‘setup.py install’ command.
--python-setup-py-arguments setup_py_argument(DEPRECATED) Arbitrary argument(s) to be passed to setup.py
--python-trusted-host PYPI_TRUSTEDMark this host or host:port pair as trusted for pip
rpm
--rpm-attr ATTRFILESet the attribute for a file (%attr), e.g. –rpm-attr 750,user1,group1:/some/file
--[no-]rpm-auto-add-directoriesAuto add directories not part of filesystem
--rpm-auto-add-exclude-directories DIRECTORIESAdditional directories ignored by ‘–rpm-auto-add-directories’ flag
--[no-]rpm-autoprovEnable RPM’s AutoProv option
--[no-]rpm-autoreqEnable RPM’s AutoReq option
--[no-]rpm-autoreqprovEnable RPM’s AutoReqProv option
--rpm-changelog FILEPATHAdd changelog from FILEPATH contents
--rpm-compression none|xz|xzmt|gzip|bzip2Select a compression method. gzip works on the most platforms.
--rpm-compression-level [0-9]Select a compression level. 0 is store-only. 9 is max compression.
--rpm-defattrdir ATTRSet the default dir mode (%defattr).
--rpm-defattrfile ATTRSet the default file mode (%defattr).
--rpm-digest md5|sha1|sha256|sha384|sha512Select a digest algorithm. md5 works on the most platforms.
--rpm-dist DIST-TAGSet the rpm distribution.
--rpm-filter-from-provides REGEXSet %filter_from_provides to the supplied REGEX.
--rpm-filter-from-requires REGEXSet %filter_from_requires to the supplied REGEX.
--rpm-group GROUPSet the group to GROUP in the %files section. Overrides the group when used with use-file-permissions setting.
--[no-]rpm-ignore-iteration-in-dependenciesFor ‘=’ (equal) dependencies, allow iterations on the specified version. Default is to be specific. This option allows the same version of a package but any iteration is permitted
--rpm-init FILEPATHAdd FILEPATH as an init script
--[no-]rpm-macro-expansioninstall-time macro expansion in %pre %post %preun %postun scripts (see: https://rpm-software-management.github.io/rpm/manual/scriptlet_expansion.html)
--[no-]rpm-old-perl-dependency-nameUse older ‘perl’ depdency name. Newer Red Hat (and derivatives) use a dependency named ‘perl-interpreter’.
--rpm-os OSThe operating system to target this rpm for. You want to set this to ‘linux’ if you are using fpm on OS X, for example
--rpm-posttrans FILEposttrans script
--rpm-pretrans FILEpretrans script
--rpm-rpmbuild-define DEFINITIONPass a –define argument to rpmbuild.
--[no-]rpm-signPass –sign to rpmbuild
--rpm-summary SUMMARYSet the RPM summary. Overrides the first line on the description if set
--rpm-tag TAGAdds a custom tag in the spec file as is. Example: –rpm-tag ‘Requires(post): /usr/sbin/alternatives’
--rpm-trigger-after-install '[OPT]PACKAGE: FILEPATH'Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: https://rpm-software-management.github.io/rpm/manual/triggers.html
--rpm-trigger-after-target-uninstall '[OPT]PACKAGE: FILEPATH'Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: https://rpm-software-management.github.io/rpm/manual/triggers.html
--rpm-trigger-before-install '[OPT]PACKAGE: FILEPATH'Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: https://rpm-software-management.github.io/rpm/manual/triggers.html
--rpm-trigger-before-uninstall '[OPT]PACKAGE: FILEPATH'Adds a rpm trigger script located in FILEPATH, having ‘OPT’ options and linking to ‘PACKAGE’. PACKAGE can be a comma seperated list of packages. See: https://rpm-software-management.github.io/rpm/manual/triggers.html
--[no-]rpm-use-file-permissionsUse existing file permissions when defining ownership and modes.
--rpm-user USERSet the user to USER in the %files section. Overrides the user when used with use-file-permissions setting.
--[no-]rpm-verbatim-gem-dependenciesWhen converting from a gem, leave the old (fpm 0.4.x) style dependency names. This flag will use the old ‘rubygem-foo’ names in rpm requires instead of the redhat style rubygem(foo).
--rpm-verifyscript FILEa script to be run on verification
sh
This package type has no additional options
snap
--snap-confinement CONFINEMENTType of confinement to use for this snap.
--snap-grade GRADEGrade of this snap.
--snap-yaml FILEPATHCustom version of the snap.yaml file.
solaris
--solaris-group GROUPSet the group to GROUP in the prototype file.
--solaris-user USERSet the user to USER in the prototype files.
tar
This package type has no additional options
virtualenv
--virtualenv-find-links PIP_FIND_LINKSIf a url or path to an html file, then parse for links to archives. If a local path or file:// url that’s a directory, then look for archives in the directory listing.
--[no-]virtualenv-fix-nameShould the target package name be prefixed?
--virtualenv-install-location DIRECTORYDEPRECATED: Use –prefix instead. Location to which to install the virtualenv by default.
--virtualenv-other-files-dir DIRECTORYOptionally, the contents of the specified directory may be added to the package. This is useful if the virtualenv needs configuration files, etc.
--virtualenv-package-name-prefix PREFIXName to prefix the package name with.
--virtualenv-pypi PYPI_URLPyPi Server uri for retrieving packages.
--virtualenv-pypi-extra-url PYPI_EXTRA_URLPyPi extra-index-url for pointing to your priviate PyPi
--[no-]virtualenv-setup-installAfter building virtualenv run setup.py install useful when building a virtualenv for packages and including their requirements from requirements.txt
--[no-]virtualenv-system-site-packagesGive the virtual environment access to the global site-packages
zip
This package type has no additional options