4.6 KiB
title | license |
---|---|
Arch Package Registry | Apache-2.0 |
Forgejo has a Arch Linux package registry, which can act as a fully working Arch linux mirror and connected directly in /etc/pacman.conf
. Forgejo automatically creates pacman database for packages in user/organization space when a new Arch package is uploaded.
Upload packages
When uploading the package to Forgejo, you have to prepare package file with the .pkg.tar.zst
extension. You can use curl or any other HTTP client, Forgejo supports multiple authentication schemes. The upload command will create 3 files: package, signature and desc file for the pacman database (which will be created automatically on request).
The following command will upload arch package and related signature to Forgejo with basic authentication:
curl -X PUT \
https://{domain}/api/packages/{owner}/arch/{group} \
--user your_username:your_token_or_password \
--header "Content-Type: application/octet-stream" \
--data-binary '@/path/to/package/file/package-1-1-x86_64.pkg.tar.zst'
Placeholder | Description |
---|---|
owner |
The owner of the package |
group |
Repository, e.g. os , extras . |
Install packages
First, you need to update your pacman configuration, adding following lines :
[{owner}.{group}.{domain}]
SigLevel = Required
Server = https://{domain}/api/packages/{owner}/arch/{group}/{architecture}
You can also copy content from the Forgejo package page.
Placeholder | Description |
---|---|
owner |
The owner of the package |
group |
Repository, e.g. os , extras |
architecture |
System architecture, such as x86_64 , aarch64 |
Then, Import the server's public key.
# Download the public key from the remote server.
wget -O sign.gpg https://{domain}/api/packages/{owner}/arch/repository.key
# Import the public key for pacman.
pacman-key --add sign.gpg
# Trust the certificate with the specified email
pacman-key --lsign-key '{owner}@noreply.{domain}'
Placeholder | Description |
---|---|
domain |
Your Forgejo domain, such as code.forgejo.org . |
owner |
The owner of the package |
Finally, you can run pacman sync command (with -y flag to load connected database file), to install your package:
pacman -Sy {package}
Delete packages
The DELETE
method will remove specific package version, and all package files related to that version:
curl -X DELETE \
https://{domain}/api/packages/{owner}/arch/{group}/{package}/{version}/{arch} \
--user your_username:your_token_or_password
Placeholder | Description |
---|---|
owner |
The owner of the package |
group |
Repository, e.g. os , extras |
package |
Package name |
version |
Package version |
arch |
Package arch |
Clients
Any pacman
compatible package manager or AUR-helper can be used to install packages from Forgejo (yay, paru, pikaur, aura). Also, any HTTP client can be used to execute get/push/remove operations (curl, postman, thunder-client).