This page covers common configuration steps for FPM (Effing Package Management).
FPM is primarily configured via command-line flags rather than configuration files.
fpm -s <source_type> -t <target_type> \
-n <package_name> \
-v <version> \
[options] \
<sources...>
# Package metadata
-n PACKAGE_NAME # Package name (required)
-v VERSION # Version (required)
--iteration ITERATION # Release/iteration number
--epoch EPOCH # Epoch for version comparison
--license LICENSE # License (MIT, GPL, Apache-2.0, etc.)
--vendor VENDOR # Vendor/manufacturer
--category CATEGORY # Package category
--url URL # Project homepage
--description DESC # Package description
# Dependencies
-d DEPENDENCY # Add dependency (can be repeated)
Example: -d "python3 >= 3.8"
Example: -d "libc6"
# Conflicts and replacements
--conflicts PACKAGE # Conflicting packages
--replaces PACKAGE # Packages this replaces
--provides FEATURE # Features this provides
# Scripts
--before-install FILE # preinst script
--after-install FILE # postinst script
--before-remove FILE # prerm script
--after-remove FILE # postrm script
# File mapping
-C CHDIR # Change to directory before adding files
-p OUTPUT # Output package path
Example: -p /tmp/package.deb
Example: -p "package-VERSION_ARCH.deb"
# Architecture and OS
-a ARCHITECTURE # Architecture (amd64, all, etc.)
--architecture ARCH # Same as -a
--target-os OS # Target operating system
-s dir # Directory of files
-s gem # Ruby gem
-s python # Python module (setup.py)
-s npm # Node.js package
-s tar # Tar archive
-s rpm # RPM package (convert to other formats)
-s deb # DEB package (convert to other formats)
-s cpan # Perl CPAN module
-s pear # PHP PEAR package
-t deb # Debian/Ubuntu package
-t rpm # RHEL/Fedora/SUSE package
-t tar # Tar archive
-t pacman # Arch Linux package
-t osxpkg # macOS package
-t solaris # Solaris package
-t p5p # Solaris IPS package
-t pkgin # SmartOS package
fpm -s dir -t deb \
-n myapp \
-v 1.0.0 \
--license MIT \
--vendor "My Company" \
--url "https://example.com/myapp" \
--description "My awesome application" \
-d "libc6" \
-d "libssl3" \
--after-install scripts/postinst.sh \
/opt/myapp=/opt/myapp \
/etc/myapp.conf=/etc/myapp.conf
fpm -s python -t rpm \
-n python-myapp \
-v 1.0.0 \
--python-bin python3 \
--python-install-lib /usr/lib/python3/dist-packages \
setup.py
fpm -s deb -t rpm package_1.0.0_amd64.deb
#!/bin/bash
set -e
case "$1" in
configure)
# Create necessary directories
mkdir -p /var/lib/myapp
chown myapp:myapp /var/lib/myapp
# Enable and start service
systemctl enable myapp
systemctl start myapp
;;
esac
exit 0
#!/bin/bash
set -e
case "$1" in
remove|deconfigure)
# Stop and disable service
systemctl stop myapp || true
systemctl disable myapp || true
;;
esac
exit 0
FPM creates packages directly - no configuration reload needed.
# Check DEB package
dpkg-deb --info package.deb
dpkg-deb --contents package.deb
# Check RPM package
rpm -qip package.rpm
rpm -qlp package.rpm
# Install and test
sudo dpkg -i package.deb
# or
sudo rpm -ivh package.rpm
Running FPM in regulated environments? We assist with:
Secure your deployment: office@linux-server-admin.com | Contact Page