https://github.com/knu/apt-bundle
https://github.com/knu/apt-bundle
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/knu/apt-bundle
- Owner: knu
- License: bsd-2-clause
- Created: 2024-03-06T13:13:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-12T10:28:29.000Z (5 months ago)
- Last Synced: 2026-01-12T18:54:59.750Z (5 months ago)
- Language: Shell
- Size: 29.3 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apt-bundle
Apt-bundle is a simple tool to install a list of packages from a file using the apt(8) package manager on Debian/Ubuntu based systems. It is useful to set up a fresh machine or a container within a CI environment. By employing apt-bundle, you can ensure consistent package sets across different environments and seamlessly share development or runtime environments with collaborators.
## Installation
Just copy the `apt-bundle` script to a directory in your `$PATH` and make it executable.
### Use from GitHub Actions
You can use the apt-bundle action to install packages in a GitHub Actions workflow. Here is an example workflow that installs a list of packages from a Debfile in the repository.
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:
# Assume the source tree has a Debfile
- uses: actions/checkout@v4
- uses: knu/apt-bundle@v1
with:
debfile: path/to/Debfile # optional; "Debfile" by default
# ...
```
#### Inputs
- `debfile`
The path to the Debfile. The default is `Debfile` in the repository root.
## Command Usage
`apt-bundle [-n] [-v] [...]`
- `-n`
Dry-run mode. The command will not install any packages, but will show what would be done.
- `-v`
Verbose mode. The command will show the commands it runs.
- ``
The file to read the package list from. The default is `Debfile` in the current directory.
## Debfile Format
Create a text file and list the packages, source lists and keyrings you want in your environment in that file using the commands described later. This file is interpreted by `/bin/sh` (dash) as a shell script, and typically named `Debfile`. Apt-bundle looks for the file with that name in the current directory by default.
```sh
package build-essential
package libreadline-dev
package postgresql-client
# The latest version of git from ppa
ppa git-core/ppa
package git
# Google Cloud SDK from the official third-party repository
keyring cloud.google https://packages.cloud.google.com/apt/doc/apt-key.gpg
source google-cloud-sdk < []` | `package `
The first syntax is to specify a single package name with optional version constraints. The version constraints are passed to `apt satisfy` with the package name. See [Syntax of relationship fields](https://www.debian.org/doc/debian-policy/ch-relationships.html#syntax-of-relationship-fields) for details.
The second syntax is to specify a URL to a .deb file to be downloaded and installed. The URL can be an HTTPS or HTTP URL.
e.g.
```sh
package faketime
package git '>= 1:2.43.0'
package https://example.com/path/to/package.deb
```
### ppa
Usage: `ppa /`
This command adds a Personal Package Archive (PPA) to the system. The only argument to the command is the name of the PPA in the format `user/ppa`.
e.g.
```sh
ppa git-core/ppa
```
### keyring
Usage: `keyring ` | `keyring <.gpg`.
e.g.
```sh
keyring cloud.google https://packages.cloud.google.com/apt/doc/apt-key.gpg
```
### source
Usage: `source <.list`.
e.g.
```sh
source google-cloud-sdk <