Package Testing Guide
Quick reference for testing Debian packages built with FPM.
Quick Workflow
Section titled “Quick Workflow”# 1. Inspect packagedpkg-deb --info packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb
# 2. Installsudo dpkg -i packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb
# 3. Testnetshare-mounter --help
# 4. Removesudo apt remove netshare-mounterEssential Commands
Section titled “Essential Commands”Before Installation
Section titled “Before Installation”Inspect package metadata:
dpkg-deb --info packages/debian-ubuntu/netshare-mounter_1.0.0_all.debShows: name, version, dependencies, maintainer, description
View package contents:
dpkg-deb --contents packages/debian-ubuntu/netshare-mounter_1.0.0_all.debShows: all files that will be installed and their locations
Installation
Section titled “Installation”Install package:
sudo dpkg -i packages/debian-ubuntu/netshare-mounter_1.0.0_all.debFix missing dependencies (if needed):
sudo apt-get install -fVerify Installation
Section titled “Verify Installation”Check package is installed:
dpkg -l | grep netshare-mounterFind executable location:
which netshare-mounterList all installed files:
dpkg -L netshare-mounterView package info:
dpkg -s netshare-mounterTest Functionality
Section titled “Test Functionality”Test executable:
netshare-mounter --versionnetshare-mounter --helpnetshare-mounter mount --helpTest man pages:
man netshare-mounterman netshare-mounter-mountCheck documentation:
ls /usr/share/doc/netshare-mounter/cat /usr/share/doc/netshare-mounter/README.mdUninstallation
Section titled “Uninstallation”Remove package (keeps config files):
sudo apt remove netshare-mounterPurge package (removes everything):
sudo apt purge netshare-mounterVerify removal:
which netshare-mounter # Should return nothingdpkg -l | grep netshare-mounter # Should be emptyComplete Test Script
Section titled “Complete Test Script”Save as test-package.sh:
#!/bin/bashset -e
PACKAGE="packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb"
echo "=== Package Testing ==="echo
echo "1. Installing..."sudo dpkg -i "$PACKAGE"sudo apt-get install -f -y
echo "2. Verifying installation..."which netshare-mounterdpkg -s netshare-mounter | grep Status
echo "3. Testing functionality..."netshare-mounter --versionnetshare-mounter --help > /dev/null
echo "4. Testing man pages..."man netshare-mounter > /dev/null 2>&1
echo "5. Listing installed files..."dpkg -L netshare-mounter
echoecho "✓ All tests passed!"echo "To remove: sudo apt remove netshare-mounter"Make executable and run:
chmod +x test-package.sh./test-package.shQuick One-Liners
Section titled “Quick One-Liners”# Install and testsudo dpkg -i packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb && netshare-mounter --help
# Full test cycle (install, test, remove)sudo dpkg -i packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb && netshare-mounter --version && sudo apt remove netshare-mounter
# Reinstall (useful for testing updates)sudo apt remove netshare-mounter && sudo dpkg -i packages/debian-ubuntu/netshare-mounter_1.0.0_all.debCommon Issues
Section titled “Common Issues”Issue: “dependency problems”
Section titled “Issue: “dependency problems””# Fix with aptsudo apt-get install -fIssue: “command not found” after install
Section titled “Issue: “command not found” after install”# Check if installed correctlywhich netshare-mounterdpkg -L netshare-mounter | grep bin
# May need to reload shell or use absolute path/usr/local/bin/netshare-mounter --helpIssue: “package is already installed”
Section titled “Issue: “package is already installed””# Remove old version firstsudo apt remove netshare-mountersudo dpkg -i packages/debian-ubuntu/netshare-mounter_1.0.0_all.debIssue: “man page not found”
Section titled “Issue: “man page not found””# Check if installedls /usr/share/man/man1/netshare-mounter.1
# Update man databasesudo mandbTesting Checklist
Section titled “Testing Checklist”- Package metadata is correct (
dpkg-deb --info) - Files install to correct locations (
dpkg-deb --contents) - Package installs without errors (
dpkg -i) - Executable is in PATH (
which command) - Command runs and shows help (
command --help) - Man pages work (
man command) - Documentation installed (
ls /usr/share/doc/) - Package removes cleanly (
apt remove) - No leftover files after removal
Related Documentation
Section titled “Related Documentation”- FPM Packaging Guide - How to create packages
- dpkg manual - Full dpkg reference