Installing cloudflared on Fedora 39 Silverblue

I performed the following steps on Fedora 39 Silverblue (aarch64):

wget https://github.com/cloudflare/cloudflared/releases/download/2023.10.0/cloudflared-linux-aarch64.rpm
sudo rpm-ostree install cloudflared-linux-aarch64.rpm

I expected cloudflared to be installed and work correctly,
Instead I saw:

Running post scripts... done
error: Running %post for cloudflared: bwrap(/bin/sh): Child process killed by signal 1; run `journalctl -t 'rpm-ostree(cloudflared.post)'` for more information
$ journalctl -xet 'rpm-ostree(cloudflared.post)'
Dec 03 11:37:32 pi rpm-ostree(cloudflared.post)[72347]: ln: failed to create symbolic link '/usr/local/bin/cloudflared': No such file or directory

Installing to /usr/local/ is not supported by rpm-ostree - Determine support path for RPMs that install into `/opt`, `/usr/local` etc · Issue #233 · coreos/rpm-ostree · GitHub

A possible workaround is to explode the RPM to disk and copy the binary to /usr/local/bin

Looking at the RPM itself, it seems to be installing to /usr/bin/cloudflared, so there must be a %post section in the RPM that is trying to create the symlink:

$ rpm2cpio cloudflared-linux-aarch64.rpm | cpio -idmv
./usr/bin/cloudflared
./usr/share/man/man1/cloudflared.1
67960 blocks

After exploding to disk as shown above, just do:

$ sudo cp ./usr/bin/cloudflared /usr/local/bin/
$ ls -l /usr/local/bin/cloudflared 
-rwxr-xr-x. 1 root root 34794572 Dec  4 10:25 /usr/local/bin/cloudflared

There’s also an existing upstream issue that covers this problem - 🐛cloudflared fails to install on RHEL CoreOS · Issue #1035 · cloudflare/cloudflared · GitHub

1 Like