cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

🐛 Can't uninstall cloudflared

Open alexander-zierhut opened this issue 1 year ago • 3 comments

Describe the bug It it no longer possible for me to uninstall cloudflared.

To Reproduce Steps to reproduce the behavior:

  • Sadly, I don't know how. For me it happened after trying to uninstall it to then reinstall it as an old tunnel was stuck and I could no longer remove it.

Environment and versions

  • OS: Ubuntu
  • Architecture: AMD64
  • Version: Jammy 22.04.3

Logs and errors

redacted@redacted:~/Downloads$ sudo apt-get remove cloudflared
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  cloudflared
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
17 not fully installed or removed.
After this operation, 36,5 MB disk space will be freed.
Do you want to continue? [Y/n] 
dpkg: error processing package cloudflared (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
dpkg: too many errors, stopping
Errors were encountered while processing:
 cloudflared
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
redacted@redacted:~/Downloads$ sudo dpkg --remove --force-remove-reinstreq cloudflared
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
(Reading database ... 367770 files and directories currently installed.)
Removing cloudflared (2023.8.2) ...
rm: cannot remove '/usr/local/bin/cloudflared': No such file or directory
dpkg: error processing package cloudflared (--remove):
 installed cloudflared package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 cloudflared

When running apt upgrade

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 /var/cache/apt/archives/cloudflared_2023.10.0_amd64.deb (--unpack):
 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
 
Errors were encountered while processing:
 /var/cache/apt/archives/cloudflared_2023.10.0_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Also bash: /usr/bin/cloudflared: No such file or directory

alexander-zierhut avatar Nov 13 '23 14:11 alexander-zierhut

I would like to add more context to this, but I am not quite sure how.

alexander-zierhut avatar Nov 13 '23 14:11 alexander-zierhut

Have exactly the same issue, be nice to get a fix for this.

Xtra89 avatar Nov 17 '23 12:11 Xtra89

Have exactly the same issue, be nice to get a fix for this.

Have you dealt with this yet?

You could try the following: sudo touch /usr/local/bin/cloudflared

Why? Because in my case the script error mentions: rm: cannot remove '/usr/local/bin/cloudflared': No such file or directory

You might want to read closely before doing this as this is already likely caused by some manual deleting like described in https://github.com/cloudflare/cloudflared/issues/686#issuecomment-1678431384

alexander-zierhut avatar Dec 06 '23 13:12 alexander-zierhut