Installing Caddy on Rasberry Model B

1. Caddy version: caddy_2.6.2_linux_armv6

2. How I installed, and run Caddy:

a. System environment:

Linux raspberry 5.15.84+ on Model B Revision 2.0 with ARMv6 CPU

3. The problem I’m having:

First I tried the way described : here, but got this error. which led to trying to install the caddy_2.6.2_linux_armv6 directly from github for my Rasberry.
This results in the following error messages.

4. Error messages and/or full log output:

Breece@raspberry:~ $ sudo dpkg -i caddy_2.6.2_linux_armv6.deb
(Reading database ... 46005 files and directories currently installed.)
Preparing to unpack caddy_2.6.2_linux_armv6.deb ...
Unpacking caddy (2.6.2) over (2.6.2) ...
Setting up caddy (2.6.2) ...
Job for caddy.service failed because the control process exited with error code.
See "systemctl status caddy.service" and "journalctl -xe" for details.
Processing triggers for man-db (2.9.4-2) ...
Breece@raspberry:~ $ systemctl status caddy.service
● caddy.service - Caddy
     Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2023-02-05 12:28:13 CET; 10s ago
   Main PID: 6725 (code=exited, status=203/EXEC)
        CPU: 129ms

Feb 05 12:28:13 raspberry systemd[1]: Starting Caddy...
Feb 05 12:28:13 raspberry systemd[6725]: caddy.service: Failed to execute /usr/bin/caddy: Permission denied
Feb 05 12:28:13 raspberry systemd[6725]: caddy.service: Failed at step EXEC spawning /usr/bin/caddy: Permission denied
Feb 05 12:28:13 raspberry systemd[1]: caddy.service: Main process exited, code=exited, status=203/EXEC
Feb 05 12:28:13 raspberry systemd[1]: caddy.service: Failed with result 'exit-code'.
Feb 05 12:28:13 raspberry systemd[1]: Failed to start Caddy.
Breece@raspberry:~ $ sudo dpkg-divert --divert /usr/bin/caddy.default --rename /usr/bin/caddy
Leaving 'local diversion of /usr/bin/caddy to /usr/bin/caddy.default'
Breece@raspberry:~ $ sudo mv ./caddy /usr/bin/caddy.custom
mv: cannot stat './caddy': No such file or directory

5. What I already tried:

For the last error I tried sudo chmod +x /usr/bin/caddy.custom but did not change it. I also tried to run custom binaries as described here but got the third error message as seen in 4.

6. Links to relevant resources:

These steps only make sense if you have a custom build of Caddy not provided by an debian package.

I suggest starting from scratch. Run sudo apt purge caddy to get rid of every file created by the package, then run sudo rm -rf /usr/bin/caddy* to wipe out any binary that you might have copied there. Then undo the diversions with sudo dpkg-divert --remove /usr/bin/caddy and update-alternatives --config caddy to reset it to the default.

Then, install the armv6 .deb with sudo dpkg -i caddy_2.6.2_linux_armv6.deb once again. Hopefully it should be clean.

1 Like

Thank you so much :slight_smile: I should have realized a “clean start” was necessary!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.