A declarative, Brewfile-like wrapper for apt, inspired by brew bundle — not a full config management system.
📚 Full Documentation | Installation | Usage
apt-bundle provides a simple, declarative, and shareable way to manage apt packages and repositories on Debian-based systems. Define your system dependencies in an Aptfile and install them with a single command.
- 📦 Declarative Package Management: Define packages in a simple text file
- 🔄 Idempotent Operations: Safe to run multiple times
- 🔑 Repository & Key Management: Add PPAs, custom repositories, and GPG keys
- 📝 Version Pinning: Install specific package versions
- 🚀 Simple CLI: Easy-to-use command-line interface
Install the latest release using the install script:
curl -fsSL https://raw.githubusercontent.com/apt-bundle/apt-bundle/main/install.sh | sudo bashDownload and install the appropriate .deb package for your architecture:
# Detect your architecture
ARCH=$(dpkg --print-architecture)
# Download latest release (replace v1.0.0 with actual version)
VERSION=$(curl -s https://api.github.com/repos/apt-bundle/apt-bundle/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
curl -LO https://github.com/apt-bundle/apt-bundle/releases/download/${VERSION}/apt-bundle_${VERSION#v}_linux_${ARCH}.deb
# Install
sudo dpkg -i apt-bundle_${VERSION#v}_linux_${ARCH}.deb
sudo apt-get install -f # Install dependencies if needed# Clone the repository
git clone https://github.com/apt-bundle/apt-bundle.git
cd apt-bundle
# Build and install
make build
sudo make installThe binary will be installed to /usr/local/bin/apt-bundle.
# Build the binary
make build
# The binary will be in build/apt-bundle
./build/apt-bundle --help# Install packages from Aptfile (default: ./Aptfile)
sudo apt-bundle
# or explicitly
sudo apt-bundle install
# Use a different Aptfile
sudo apt-bundle --file /path/to/Aptfile
# Skip updating package lists (useful in CI/CD)
sudo apt-bundle --no-update
# Check if packages are installed (no root required)
apt-bundle check
# Generate an Aptfile from current system
apt-bundle dump > AptfileThe Aptfile is a simple line-oriented text file with the following directives:
# Install latest version
apt vim
apt curl
apt git
# Install specific version
apt "nano=2.9.3-2"
ppa ppa:ondrej/php
apt php8.1
# Add GPG key
key https://download.docker.com/linux/ubuntu/gpg
# Add repository
deb "[arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
# Install packages from the repository
apt docker-ce
apt docker-ce-cli
# Core development tools
apt build-essential
apt curl
apt git
apt vim
apt htop
# Specific version
apt "nano=2.9.3-2"
# PHP from PPA
ppa ppa:ondrej/php
apt php8.1
apt php8.1-cli
apt php8.1-fpm
# Docker
key https://download.docker.com/linux/ubuntu/gpg
deb "[arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt docker-ce
apt docker-ce-cli
apt containerd.io
# Clone project
git clone https://github.com/myorg/myproject.git
cd myproject
# Install all system dependencies
sudo apt-bundleUse apt-bundle in your Dockerfiles to manage system dependencies declaratively. See the examples directory for complete working examples:
# On primary workstation
apt-bundle dump > Aptfile
# On new laptop
sudo apt-bundleapt-bundle/
├── cmd/
│ └── apt-bundle/ # Main entry point
├── internal/
│ ├── apt/ # APT interactions (packages, repos, keys)
│ ├── aptfile/ # Aptfile parsing
│ └── commands/ # CLI commands (install, dump, check)
├── examples/ # Docker examples by installation method
├── docs/ # Documentation site and APT repository
├── specs/ # Requirements and technical specifications
├── Makefile # Build automation
└── go.mod # Go module definition
# Format code
make fmt
# Run static analysis
make vet
# Run tests
make test
# Build
make build
# Install locally for testing
sudo make install- Go 1.21 or later
- Debian/Ubuntu-based system (for running the tool)
The project uses a VERSION file for version management:
- The
VERSIONfile contains the major.minor version (e.g.,1.0) - Patch versions are automatically incremented on each release
- To update the major or minor version, edit the
VERSIONfile - Releases are automatically created when code is merged to the
mainbranch
- Self-contained: The Go binary is statically linked and doesn't require external
.soor.dllfiles - CGO_ENABLED=0: Ensures pure Go compilation without C dependencies
- Small size: Compiled with
-ldflags="-s -w"to strip debug symbols
📚 Full Documentation Site - Complete user guide, developer documentation, and API reference
For internal specifications:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.