SkillAgentSearch skills...

Alpkg

Set up Alpine Linux packaging environment with a breeze! πŸ”

Install / Use

/learn @orhun/Alpkg

README

alpkg πŸ”

GitHub Workflow Status

Set up Alpine Linux packaging environment with a breeze! See this blog post.

alpkg demo

alpkg is a tool for all your Alpine packaging needs. It can create a chroot with preinstalled tools in a matter of seconds, set up aports repository, and fetch/update packages. Most importantly, it provides a split layout via Zellij for easy editing/building APKBUILD files.

Requirements

Usage

Usage: alpkg [init|edit|fetch|update] [<package>]

Commands:
  init              Initialize an Alpine chroot.
  edit <package>    Edit or create a package.
  fetch <package>   Fetch an existing package from the remote repository.
  update <package>  Update the package on the remote repository.
  destroy           Remove the chroot and repository.

Options:
  --packager "Your Name <your@email.address>"              The name and email address of the package maintainer.
  --aports "https://gitlab.alpinelinux.org/<user>/aports"  The URL of the remote APorts repository.

Environment variables:
  CHROOT_DIR   Directory for Alpine chroot. (default: /alpine)
  APORTS_DIR   Directory for remote APorts repository. (default: /home/user/aports)
  PACKAGE_DIR  Directory for APK packages built and stored. (default: /home/user/apkbuilds in chroot)

Features

init

To create an Alpine Linux chroot and initialize aports repository for packaging, simply run:

alpkg init --packager "Your Name <your@email.address>" --aports "https://gitlab.alpinelinux.org/<user>/aports"

It is possible to pass options to alpine-chroot-install via environment variables.

<details> <summary>Demo</summary>

alpkg init

</details>

* You need to create an account on https://gitlab.alpinelinux.org and fork the aports repository under your user.

* If you run alpkg init in your $HOME directory, the Alpine working directory will point to $HOME/apkbuilds.

edit

To create a new APKBUILD, you can use the edit command. Note that it uses newapkbuild under the hood so you can pass newapkbuild options to it:

alpkg edit <newapkbuild_opts> <package_name>

For example:

alpkg edit -r -d "A highly customizable changelog generator" -l "GPL-3.0-only" -u "https://github.com/orhun/git-cliff" git-cliff

Or you can generate an empty package with the following command:

alpkg edit testpkg
<details> <summary>Demo</summary>

alpkg edit I

</details>

If the package already exists, you can also use edit command to edit the contents of the APKBUILD.

<details> <summary>Demo</summary>

alpkg edit II

</details>

fetch

To fetch existing packages from aports and edit them:

alpkg fetch <package_name>
<details> <summary>Demo</summary>

alpkg fetch

</details>

update

To commit the changes to the aports repository:

alpkg update <package_name>
<details> <summary>Demo</summary>

alpkg update

</details>

License

This project is licensed under The MIT License.

Copyright

Copyright Β© 2023, Orhun ParmaksΔ±z

View on GitHub
GitHub Stars28
CategoryDevelopment
Updated6mo ago
Forks3

Languages

Shell

Security Score

87/100

Audited on Sep 11, 2025

No findings