{"id":40037353,"url":"https://github.com/apt-bundle/apt-bundle","last_synced_at":"2026-04-05T22:11:25.890Z","repository":{"id":324761335,"uuid":"1098019837","full_name":"apt-bundle/apt-bundle","owner":"apt-bundle","description":"A declarative, Brewfile-like wrapper for apt, inspired by brew bundle — not a full config management system.","archived":false,"fork":false,"pushed_at":"2026-02-15T00:16:18.000Z","size":9915,"stargazers_count":30,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-15T01:08:07.596Z","etag":null,"topics":["apt","package-manager-apt"],"latest_commit_sha":null,"homepage":"https://apt-bundle.org/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apt-bundle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":"COPYRIGHT","agents":null,"dco":null,"cla":null}},"created_at":"2025-11-17T06:38:14.000Z","updated_at":"2026-02-15T00:01:50.000Z","dependencies_parsed_at":"2026-01-19T05:17:25.331Z","dependency_job_id":null,"html_url":"https://github.com/apt-bundle/apt-bundle","commit_stats":null,"previous_names":["apt-bundle/apt-bundle"],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/apt-bundle/apt-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apt-bundle%2Fapt-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apt-bundle%2Fapt-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apt-bundle%2Fapt-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apt-bundle%2Fapt-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apt-bundle","download_url":"https://codeload.github.com/apt-bundle/apt-bundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apt-bundle%2Fapt-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29694200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T18:18:25.093Z","status":"ssl_error","status_checked_at":"2026-02-21T18:18:22.435Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apt","package-manager-apt"],"created_at":"2026-01-19T05:00:31.584Z","updated_at":"2026-04-05T22:11:24.048Z","avatar_url":"https://github.com/apt-bundle.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# apt-bundle\n\n[![CI](https://github.com/apt-bundle/apt-bundle/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/apt-bundle/apt-bundle/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA declarative, Brewfile-like wrapper for `apt`, inspired by `brew bundle` — not a full config management system.\n\n**[📚 Full Documentation](https://apt-bundle.github.io/apt-bundle/)** | [Installation](#installation) | [Usage](#usage)\n\n## Overview\n\n`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.\n\n## Features\n\n- 📦 **Declarative Package Management**: Define packages in a simple text file\n- 🔄 **Idempotent Operations**: Safe to run multiple times\n- 🔀 **Sync**: Make system match Aptfile in one command (install + cleanup)\n- 🔑 **Repository \u0026 Key Management**: Add PPAs, custom repositories, and GPG keys\n- 📝 **Version Pinning**: Install specific package versions\n- 🚀 **Simple CLI**: Easy-to-use command-line interface\n\n## Why apt-bundle?\n\n**Why not just bash scripts?** Idempotency is hard to get right; repository and key management is error-prone; and scripts become unmaintainable as they grow. apt-bundle gives you a single, declarative file and predictable behavior every time.\n\n**Comparison to alternatives:**\n\n| vs | apt-bundle advantage |\n|----|------------------------|\n| `dpkg --get-selections` | Human-readable Aptfile format, handles repos and keys, supports partial adoption |\n| Ansible / Chef | Zero learning curve, no YAML or DSL—just packages and directives |\n| Nix | Works with your existing apt ecosystem; no paradigm shift |\n\n**Key benefits:** The Aptfile is declarative and shareable (commit it to git). Use `apt-bundle dump` to generate an Aptfile from your current system, `apt-bundle check` to validate without installing, `apt-bundle sync` to make the system match the Aptfile in one command (install + cleanup), and `apt-bundle cleanup` to remove packages no longer in the Aptfile (when using state-tracked installs).\n\n## Installation\n\n### Quick Install (Recommended)\n\nInstall the latest release using the install script:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/apt-bundle/apt-bundle/main/install.sh | sudo bash\n```\n\n### Manual Installation from .deb Package\n\nDownload and install the appropriate `.deb` package for your architecture:\n\n```bash\n# Detect your architecture\nARCH=$(dpkg --print-architecture)\n\n# Download latest release (replace v1.0.0 with actual version)\nVERSION=$(curl -s https://api.github.com/repos/apt-bundle/apt-bundle/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\\1/')\ncurl -LO https://github.com/apt-bundle/apt-bundle/releases/download/${VERSION}/apt-bundle_${VERSION#v}_linux_${ARCH}.deb\n\n# Install\nsudo dpkg -i apt-bundle_${VERSION#v}_linux_${ARCH}.deb\nsudo apt-get install -f  # Install dependencies if needed\n```\n\n### From Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/apt-bundle/apt-bundle.git\ncd apt-bundle\n\n# Build and install\nmake build\nsudo make install\n```\n\nThe binary will be installed to `/usr/local/bin/apt-bundle`.\n\n### Building\n\n```bash\n# Build the binary\nmake build\n\n# The binary will be in build/apt-bundle\n./build/apt-bundle --help\n```\n\n## Usage\n\n### Basic Commands\n\n```bash\n# Install packages from Aptfile (default: ./Aptfile)\nsudo apt-bundle\n\n# or explicitly\nsudo apt-bundle install\n\n# Use a different Aptfile\nsudo apt-bundle --file /path/to/Aptfile\n\n# Skip updating package lists (useful in CI/CD)\nsudo apt-bundle --no-update\n\n# See what would be installed/added without making changes\nsudo apt-bundle install --dry-run\n\n# Make system match Aptfile (install missing, remove no-longer-listed)\nsudo apt-bundle sync\n# See what would be installed/removed without making changes\nsudo apt-bundle sync --dry-run\n\n# Check if packages/repos/keys from Aptfile are present (exit 0 only if all present)\napt-bundle check\n# Machine-friendly output for CI\napt-bundle check --json\n\n# Validate Aptfile and check environment (apt-get, add-apt-repository, state)\napt-bundle doctor\n# Only validate Aptfile (no environment checks)\napt-bundle doctor --aptfile-only\n\n# List packages with available upgrades (exit 1 if any; for CI)\napt-bundle outdated\n\n# Generate an Aptfile from current system\napt-bundle dump \u003e Aptfile\n```\n\nNote: `dump` emits repository lines but not key directives for repos that use Signed-By; you may need to add those manually when installing from a dumped Aptfile.\n\n### Aptfile Format\n\nThe `Aptfile` is a simple line-oriented text file with the following directives:\n\n#### Install Packages\n\n```aptfile\n# Install latest version\napt vim\napt curl\napt git\n\n# Install specific version\napt \"nano=2.9.3-2\"\n```\n\n#### Add PPAs\n\n```aptfile\nppa ppa:ondrej/php\napt php8.1\n```\n\n#### Add Custom Repositories\n\n```aptfile\n# Add GPG key\nkey https://download.docker.com/linux/ubuntu/gpg\n\n# Add repository\ndeb \"[arch=amd64] https://download.docker.com/linux/ubuntu focal stable\"\n\n# Install packages from the repository\napt docker-ce\napt docker-ce-cli\n```\n\n### Complete Example\n\n```aptfile\n# Core development tools\napt build-essential\napt curl\napt git\napt vim\napt htop\n\n# Specific version\napt \"nano=2.9.3-2\"\n\n# PHP from PPA\nppa ppa:ondrej/php\napt php8.1\napt php8.1-cli\napt php8.1-fpm\n\n# Docker\nkey https://download.docker.com/linux/ubuntu/gpg\ndeb \"[arch=amd64] https://download.docker.com/linux/ubuntu focal stable\"\napt docker-ce\napt docker-ce-cli\napt containerd.io\n```\n\n## Use Cases\n\n### Developer Onboarding\n\n```bash\n# Clone project\ngit clone https://github.com/myorg/myproject.git\ncd myproject\n\n# Install all system dependencies\nsudo apt-bundle\n```\n\n### Dockerfile\n\nUse `apt-bundle` in your Dockerfiles to manage system dependencies declaratively. See the [examples directory](examples/) for complete working examples:\n\n- **[1-via-install-sh](examples/1-via-install-sh/)** - Install apt-bundle using the install script\n- **[2-via-ppa](examples/2-via-ppa/)** - Install apt-bundle from the PPA\n- **[3-via-apt-get](examples/3-via-apt-get/)** - Install apt-bundle via apt-get from the APT repository\n- **[4-complex-via-apt-get](examples/4-complex-via-apt-get/)** - Multi-stage build with separate build/runtime Aptfiles\n\n### System Sync\n\n```bash\n# On primary workstation\napt-bundle dump \u003e Aptfile\n\n# On new laptop\nsudo apt-bundle\n```\n\n## Development\n\n### Project Structure\n\n```\napt-bundle/\n├── cmd/\n│   └── apt-bundle/       # Main entry point\n├── internal/\n│   ├── apt/              # APT interactions (packages, repos, keys)\n│   ├── aptfile/          # Aptfile parsing\n│   └── commands/         # CLI commands (install, dump, check)\n├── examples/             # Docker examples by installation method\n├── docs/                 # Documentation site and APT repository\n├── specs/                # Requirements and technical specifications\n├── Makefile              # Build automation\n└── go.mod                # Go module definition\n```\n\n### Building and Testing\n\n```bash\n# Format code\nmake fmt\n\n# Run static analysis\nmake vet\n\n# Run tests\nmake test\n\n# Build\nmake build\n\n# Install locally for testing\nsudo make install\n```\n\n### Pre-commit Hook\n\nInstall the pre-commit hook to automatically format, lint, and verify Go code before each commit:\n\n```bash\nmake install-hooks\n```\n\nThe hook runs `golangci-lint --fix`, verifies the build, and runs lint. It only runs when Go files are staged (docs-only commits are skipped).\n\n### Requirements\n\n- Go 1.21 or later\n- Debian/Ubuntu-based system (for running the tool)\n\n### Version Management\n\nThe project uses a VERSION file for version management:\n- The `VERSION` file contains the major.minor version (e.g., `1.0`)\n- Patch versions are automatically incremented on each release\n- To update the major or minor version, edit the `VERSION` file\n- Releases are automatically created when code is merged to the `main` branch\n\n## Technical Details\n\n### Binary Characteristics\n\n- **Self-contained**: The Go binary is statically linked and doesn't require external `.so` or `.dll` files\n- **CGO_ENABLED=0**: Ensures pure Go compilation without C dependencies\n- **Small size**: Compiled with `-ldflags=\"-s -w\"` to strip debug symbols\n\n### Dependencies\n\n- [spf13/cobra](https://github.com/spf13/cobra) - CLI framework\n\n## Documentation\n\n📚 **[Full Documentation Site](https://apt-bundle.github.io/apt-bundle/)** - Complete user guide, developer documentation, and API reference\n\nFor internal specifications:\n- [Requirements](specs/requirements.md) - Detailed functional requirements\n- [Technical Specification](specs/tech-specs.md) - Aptfile format and implementation details\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapt-bundle%2Fapt-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapt-bundle%2Fapt-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapt-bundle%2Fapt-bundle/lists"}