You are not logged in.
I am trying to build a minimal Arch Linux image using mkosi, following mkosi’s documented Arch support.
mkosi consistently fails at the very first pacman invocation with:
error: 'failed to resolve path '/var/cache/pacman/pkg' passed to '--cachedir': No such file or directory
"pacman --root=/buildroot --logfile=/dev/null --dbpath=/var/lib/pacman \
--cachedir=/var/cache/pacman/mkosi \
--cachedir=/var/cache/pacman/pkg \
--hookdir=/buildroot/etc/pacman.d/hooks \
--arch x86_64 --noconfirm --sync --refresh"
Notes / observations:
- `/var/cache/pacman/pkg` exists on the host:
$ ls -ld /var/cache/pacman/pkg
drwxr-xr-x 1 - root 15 Dec 18:19 /var/cache/pacman/pkg/
- The error persists even if:
- the directory exists on the host
- the directory exists inside the image root
- the directory is pre-created via mkosi.extra-tree
- mkosi hooks are used
Minimal mkosi.conf used:
```
[Distribution]
Distribution=arch
[Output]
Format=directory
[Content]
Packages=base linux systemd
Bootable=yes
[Build]
Environment=arch
```
Offline
Offline
Thanks a lot! I picked a great time to try new tech, hehe.
Offline
I also opened https://github.com/systemd/mkosi/issues/4081
Offline
Meanwhile you can work around this by creating "mkosi.pkgcache/cache/pacman/pkg" alongside your "mkosi.conf" (might require mkosi v26). This creates the missing cache directory.
Offline
Hadn't the fix for this been in the repos for a week now?
Edit: there is still an issue with setting the cachedir on the command-line
Offline
The issue is fixed on mkosi main, so if you install mkosi from git your images should build again.
Offline