Error upgrading cloudflared

I get the following when trying to upgrade:

[email protected] : ~ $ sudo dpkg -i ./cloudflared-linux-amd64.deb

(Reading database … 157699 files and directories currently installed.)

Preparing to unpack ./cloudflared-linux-amd64.deb …

Unpacking cloudflared (2021.10.3) over (2021.10.3) …

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-linux-amd64.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.1-1) …

Errors were encountered while processing:

./cloudflared-linux-amd64.deb

I’ve even added the Ubuntu repo for cloudflared and that gets the same error.

Which version of Ubuntu are you running?

And, of course, is there a /usr/local/bin/cloudflared? There is on my Ubuntu 20.04 systems.

Though I have to admit that all I’ve done in the past was ‘sudo cloudflared update’

20.04.2-Ubuntu

I installed this cloudflared using these instructions several months ago: https://developers.cloudflare.com/cloudflare-one/tutorials/ssh

I figured out a fix.

I did a sudo mkdir /usr/local/bin

Then sudo touch /usr/local/bin/cloudflared

I ran the apt installer for cloudflared and it worked

I’m on .3 – close enough.

This is what I did way back the first time around:

wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.deb
apt install ./cloudflared-stable-linux-amd64.deb