gitea/docs/content/usage/packages/arch.en-us.md
Danila Fominykh 16da9f90b3
Update docs/content/usage/packages/arch.en-us.md
Co-authored-by: silverwind <me@silverwind.io>
2023-11-01 19:58:58 -03:00

2.7 KiB

date title weight toc draft menu
2016-11-08T16:00:00+02:00 Arch Package Registry 10 true false
sidebar
parent name weight identifier
packages Arch 10 arch

Arch package registry

Gitea has a Arch Linux package registry, which can act as a fully working Arch linux mirror and connected directly in /etc/pacman.conf. Gitea automatically creates pacman database for packages in user/organization space when a new Arch package is uploaded.

Table of Contents

{{< toc >}}

Install packages

First, you need to update your pacman configuration, adding following lines:

[{owner}.{domain}]
SigLevel = Optional TrustAll
Server = https://{domain}/api/packages/{owner}/arch/{distribution}/{architecture}

Then, you can run pacman sync command (with -y flag to load connected database file), to install your package:

pacman -Sy package

Upload packages

When uploading the package to gitea, you have to prepare package file with the .pkg.tar.zst extension and its .pkg.tar.zst.sig signature. You can use curl or any other HTTP client, Gitea 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 gitea with basic authentification:

curl -X PUT \
  https://{domain}/api/packages/{owner}/arch/push/{package-1-1-x86_64.pkg.tar.zst}/{archlinux}/$(xxd -p package-1-1-x86_64.pkg.tar.zst.sig | tr -d '\n') \
  --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'

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/{user}/arch/remove/{package}/{version} \
  --user your_username:your_token_or_password

Clients

Any pacman compatible package manager or AUR-helper can be used to install packages from gitea (yay, paru, pikaur, aura). Alternatively, you can try pack which supports full gitea API (install/push/remove). Also, any HTTP client can be used to execute get/push/remove operations (curl, postman, thunder-client).