Skip to content

I've finally set up my own automated repository thanks to aurutils

I've always tried to improve the way I build my own packages on Arch. It basically started with building in a clean chroot some years ago until I transitioned to using aurutils about one year ago.

Today I finally took the time to somewhat automate the process on a VPS — that means regularly checking the AUR for updates, cleanbuilding the packages and serving them over HTTPS. Most of the setup I performed with Ansible (not everything though) using self-written playbooks; though I'm not claiming that those scripts are perfect. But it was a good exercise.

I don't know if there is general interest in the topic or if most people are content with how the AUR process works. I am a bit against the AUR helpers (though e.g. yay takes a lot of work off me on some machines) because I prefer using repositories. That's why I put up with the work.

It is also not perfect, but this is the first time I consider it "good enough" that I want to let the sub know in case anyone here is interested.

If you want to see my results, add the following to your pacman.conf:

[laserepo]
SigLevel = Optional TrustAll
Server = https://repository.pc-hass.de/

Be aware that the packages are unsigned and I don't recommend using it for anything. It is my personal repository and adding repositories to your system is always a possible vector for vulnerabilities! That said, if you want, make use of it, but I'm just posting it here for people to see how the result looks. If you want to be safe, try it in a VM or something.

My setup uses a systemd timer to check for new packages every hour after the last run — regardless if packages have actually been built or not — completed. Or so I hope. Anyhow, there's still a lot of room for improvement, but I hope this is something that interests others as well!

I'd be happy to hear some feedback!

70 points39 comments
Open on Reddit
About this post
Posted
Archived
Score
70 · 100% up
Kind
Text
ID
angrel

Author

14
posts
390
comments
3
media
View profile

39 comments

This is also how I currently handle my aur / custom packages. (And one of the best ways imo) I've never looked back to an aur helper.

One thing to keep in mind though: you are essentially restributing packages. This may not be allowed by the license of the package. (e.g. google-chrome, spotify) I don't think I saw a package like this in your current list, but thought I would mention it anyway.

13 points

Yes, I had the redistribution issue in mind also. If it came to that, I could just set up simple authentication.

Anyhow, do you have any lessons learned you want to share? :) I see some optimization potential — things like compressed database file (though that should go into aur-utils imho). Also I noticed that aur-build has a -R flag to delete old packages, but aur-sync doesn't, so I created a pull request on Github for that and fixed another tiny bug I spotted (basically, the -r option was mentioned in the man page and --help, but it didn't work).

1 points

Anyhow, do you have any lessons learned you want to share? :)

Ehh let's see.

As Alad already partly mentioned, think about your trust path. Upstream -> AUR package maintainer -> your VPS -> your clients. Some thoughts:

  • I rebuild *-git packages automatically if there are no changes to the PKGBUILD. So if there is no gpg signature, this means inherently trusting upstream sources.
  • I am notified about, and manually inspect all changes made to all PKGBUILDs. (not trusting AUR maintainers) You can also do something similar to aurto and make a list of trusted maintainers.
  • As you already mentioned, signing the packages and database is a great idea, especially when you're distributing to multiple boxes. It's not hard to setup with aurutils and an excellent excuse to learn about gpg (using a signing subkey etc.)
  • Make sure your HTTPS connection is secure. I see you're still using TLS1.0 and TLS1.1 and haven't enabled TLS1.3. I believe TLS 1.0 and 1.1 are already being deprecated by major browsers. Maybe even only enable 1.3 as all pacman clients should be able to use this. Also think about fun stuff like DNS CAA, HSTS maybe even HPKP?

Have you thought about rebuilds? This includes ABI changes of libraries, but also version changes of python.

I also regularly check the integrity of my repository. This includes verifying package and database signatures, missing package files, missing dependencies, orphaned packages, out of date packages.

Good logging/monitoring could also be something to look at. Are you notified of build failures?

Maybe a little less common use case: I sometimes make modifications to PKGBUILDs for various reasons, so I've got a system where I can automatically apply patches to packages.

That's what I can think of of the top of my head. I've probably missed a lot of problems I've hit throughout the years. Hope this helps a bit! :) Rolling my own automation based on aurutils that does exactly what I want it to do has been a blast, and is a journey that will probably never end.

6 points

If you're pulling PKGBUILD updates directly from the AUR, you should keep in mind that these can be orphaned at any time, and thus may be adopted by anyone. So if you don't use manual inspection, you should consider some "trust system", e.g. as done in https://github.com/alexheretic/aurto (I haven't tested this, but some other helpers like bauerbill or Seblu's aurbot have a similar mechanism in place)

4 points

So is the reasoning for this basically to avoid having to build the AUR packages on your client machines?

6 points

Yes. The two primary conveniences gained from doing this are:

  • I can set up a new machine, add the repository, and simply install everything via pacman -S ...
  • I can build a package once, and distribute it to multiple machines
3 points
unknown author4 hidden

Deleted before we saved it.

2 points

yay is not inherently bad, there's nothing "wrong" with it. Let's go through the points why I set up something different:

  1. If you have more than one machine, you'd need to rebuild the packages for all of them. This way, you build once and they just update like any other.
  2. AUR helpers don't build in a clean chroot. In fact a lot of packages on the AUR are not even built in a clean chroot by the maintainer. This often leads to effectively wrong packages that cannot be shared between machines (compile options aside). A very common example, though it doesn't really show the point, is git as a missing makedepends. Because if you use the AUR, you have git installed. If you're just running makepkg, no problem. It will use your installed git. But in a clean chroot, it will error out because git is not installed there. The real issue starts with complex programs like ffmpeg. The configure step might enable functionality that was not explicitly turned off because you have the appropriate library installed, but it's not defined as a dependency. Now you build the package, everything works fine. You install the package on another machine where the library ffmpeg was linked against is not installed — it doesn't work. If you build in a clean chroot, you can be sure that all needed dependencies for the binary or library you are providing are properly declared in the package metainformation.
5 points

People use yay and don't bother learning how the AUR works, and don't bother reading PKGBUILDs when a package updates.

1 points

Hit me in my ugly face, but I say this shouldn't be necessary at all!

Not everyone must understand and check every install/update PKGBUILD. As the AUR is a community project, some might give away some security/responsibility for convenience. Also, not everyone might be into compiling stuff as we are, but also want to use Arch/AUR.

Knowing how the AUR and PKGBUILDs work is a very nice thing, but I don't like that forcing of knowing it to new users.

Still, I highly encourage to only skip reading the PKGBUILD of very popular packages. The less known a package is, the more you should at least look into the PKBUILD if it at least points to the right repository.

3 points

Very cool, I would read some blog posting about your experiences/plans :)

Also, repository.pc-hass.de points to the same stuff as only pc-hass.de. Pretty sure this is intentional, but just wanted to tell you in case it isn't to avoid testing problems.

🇩🇪 Außerdem gefällt mir der Domainname. :D Solange du keine Avocados verkaufst, passt der Name immer.

1 points

Also, repository.pc-hass.de points to the same stuff as only pc-hass.de. Pretty sure this is intentional, but just wanted to tell you in case it isn't to avoid testing problems.

It's not intentional, but I noticed as well. It's just that I don't have any other server specified and nginx then just uses the first entry, even though the hostname doesn't match. But it's not an issue at the moment so I didn't change that.

Außerdem gefällt mir der Domainname. :D Solange du keine Avocados verkaufst, passt der Name immer.

Haha ja. Heute ist das nicht mehr so schlimm, aber die Domain habe ich auch noch aus der Zeit, in der ich selber zu Hause noch Windows benutzt habe. Und mein Gedankengang damals war, dass es zwar viele Publikationen gibt, die mit "PC-" anfangen, aber für dieses Gefühl, wenn mal wieder irgendwas mit einer kryptischen Meldung nicht funktioniert, da musste genau das her.

Non-German speakers: we're discussing my domain name which roughly translates to pc-rage. It was and still kind of is a tribute to those times when you just want to punch a hole into your screen.

1 points

Windows [...] aber für dieses Gefühl, wenn mal wieder irgendwas mit einer kryptischen Meldung nicht funktioniert, da musste genau das her.

In beiden Fällen sehr zutreffend :D

1 points

I should probably try out aurutils again. Last time I set up the repo and all but I just didn't understand how to use aurutils really.

1 points

You definitely should. My biggest issue is removing packages from the repository though :D

It basically boils down to this after the initial setup:

  1. add new packages to the repository using aur sync -c $packagename. Not sure the -c is needed or if it's default, but I like it explicit.
  2. regularly check for package updates using aur sync -cu.
  3. I also did some more stuff: I added a dedicated user for building packages (though I think it needs more permissions than the official docs say or I made some mistake) and I'm serving the repository over HTTPS.

It took me a bit longer because I tried to semi-automate the setup using Ansible.

1 points

Not sure the -c is needed or if it's default, but I like it explicit.

Aurutils does not build in a chroot by default.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.