So for some backstory, Cloudflare Tunnel uses cloudflared and initially everything worked perfectly fine. I setup Cloudflare Tunnel using the following command which led to not errors:
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64.deb &&
sudo dpkg -i cloudflared.deb &&
sudo cloudflared service install
However, after getting that done and dusted I decided to work on my PiHole and tried to get dns over https working using this guide which also takes advantage of cloudflared, now I decide to not use dns over https and follow the instructions to get rid of dns over https using the following commands:
sudo systemctl stop cloudflared
sudo systemctl disable cloudflared sudo systemctl daemon-reload
sudo deluser cloudflared sudo rm /etc/default/cloudflared
sudo rm /etc/systemd/system/cloudflared.service
sudo rm /usr/local/bin/cloudflared
Now shortly after that I realise that I borked by Cloudflare Tunnel setup and it doesn’t link anymore so now I try to re-setup it using the first command however now I am left with this error:
Selecting previously unselected package cloudflared.
(Reading database ... 49827 files and directories currently installed.)
Preparing to unpack cloudflared.deb ... Unpacking cloudflared (2023.10.0) over (2023.10.0)...
rm: cannot remove '/usr/local/bin/cloudflared': No such file or directory
dpkg: warning: old cloudflared package post-removal script subprocess returned error exit status 1 dpkg: trying script from the new package instead ...
rm: cannot remove '/usr/local/bin/cloudflared': No such file or directory
dpkg: error processing archive cloudflared.deb (--install): new cloudflared package post-removal script subprocess returned error exit status 1
rm: cannot remove '/usr/local/bin/cloudflared': No such file or directory
dpkg: error while cleaning up: new cloudflared package post-removal script subprocess returned error exit status 1 Processing triggers for man-db (2.9.4-2) ... Errors were encountered while processing: cloudflared.deb
I’ve tried searching the internet on ways to completely uninstall cloudlfared and hopefully fixing this but none of them has fixed it, I’m currently wondering if there is any other way to completely uninstall Cloudflared and clean up this mess so that I can reinstall but right now chances are looking slim.
Any help would be appreciated.