Skip to content

Package Testing Guide

Quick reference for testing Debian packages built with FPM.

Terminal window
# 1. Inspect package
dpkg-deb --info packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb
# 2. Install
sudo dpkg -i packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb
# 3. Test
netshare-mounter --help
# 4. Remove
sudo apt remove netshare-mounter

Inspect package metadata:

Terminal window
dpkg-deb --info packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb

Shows: name, version, dependencies, maintainer, description

View package contents:

Terminal window
dpkg-deb --contents packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb

Shows: all files that will be installed and their locations

Install package:

Terminal window
sudo dpkg -i packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb

Fix missing dependencies (if needed):

Terminal window
sudo apt-get install -f

Check package is installed:

Terminal window
dpkg -l | grep netshare-mounter

Find executable location:

Terminal window
which netshare-mounter

List all installed files:

Terminal window
dpkg -L netshare-mounter

View package info:

Terminal window
dpkg -s netshare-mounter

Test executable:

Terminal window
netshare-mounter --version
netshare-mounter --help
netshare-mounter mount --help

Test man pages:

Terminal window
man netshare-mounter
man netshare-mounter-mount

Check documentation:

Terminal window
ls /usr/share/doc/netshare-mounter/
cat /usr/share/doc/netshare-mounter/README.md

Remove package (keeps config files):

Terminal window
sudo apt remove netshare-mounter

Purge package (removes everything):

Terminal window
sudo apt purge netshare-mounter

Verify removal:

Terminal window
which netshare-mounter # Should return nothing
dpkg -l | grep netshare-mounter # Should be empty

Save as test-package.sh:

#!/bin/bash
set -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-mounter
dpkg -s netshare-mounter | grep Status
echo "3. Testing functionality..."
netshare-mounter --version
netshare-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
echo
echo "✓ All tests passed!"
echo "To remove: sudo apt remove netshare-mounter"

Make executable and run:

Terminal window
chmod +x test-package.sh
./test-package.sh

Terminal window
# Install and test
sudo 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.deb

Terminal window
# Fix with apt
sudo apt-get install -f

Issue: “command not found” after install

Section titled “Issue: “command not found” after install”
Terminal window
# Check if installed correctly
which netshare-mounter
dpkg -L netshare-mounter | grep bin
# May need to reload shell or use absolute path
/usr/local/bin/netshare-mounter --help
Terminal window
# Remove old version first
sudo apt remove netshare-mounter
sudo dpkg -i packages/debian-ubuntu/netshare-mounter_1.0.0_all.deb
Terminal window
# Check if installed
ls /usr/share/man/man1/netshare-mounter.1
# Update man database
sudo mandb

  • 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