Artemis | Blog | About & Contact

2022 / 04 / 24 - Software discoveries (raw)

Notes about archlinux repository self-hosting

Because I am coding my own tools and softwares, I'd like to have clean packages for them. Because I use arch linux, I want to target this system. Because I like easy install and update, I want to not have to deal with cloning the PKGBUILDs manually.

I chose this weekend to set my sights on self-hosting a repository.

The doc is... more than lacking, so this page is kind of an info dump about the topic, not sorted, and not fully verified, for stuff that worked for me.

Package building

To properly build the packages, I needed a few (undocumented ? or hard to find) steps.

To properly generate the package checksum, you need to put the right value in sha256sums in the PKGBUILD file.

To do so, firstly set the value to sha256sums=('SKIP') inside the PKGBUILD file.

Then, enter updpkgsums, which will generate the checksums and edit the PKGBUILD.

Then, build your package. I use the argset -p file.PKGBUILD -fC --sign --key "...gpg key...".

For example, for files-git, I enter the following.

cd $(mktemp -d)
cp ~/git/files-git/PKGBUILD files-git.PKGBUILD
updpkgsums files-git.PKGBUILD
makepkg -p files-git.PKGBUILD -fC --sign --key "A5F733049A3391203FDCB6B34813CB8D9C3F48AC"
mv files-git-* ~/git/arch/artemis/x86_64
cd ~/git/arch/artemis/x86_64
repo-add *.pkg.tar.zst


The web server that hosts the repository must be able to follow symlinks, because the arch repo.db system is relying on it.

Additional notes (setting up the repository on a user's computer)

I added some more notes on how to use my own repository, which I think are generic enough, on the repository's README.