remote.it Community Forum

Remove packages failure

Hi all,

I had some problems while installing remote.it and although I used the service without a problem for a couple of days now I want to remove all packages and start from the beginning.

Thus I am trying to do the following with the errors as shown :

  1. Remove connectd

#apt purge connectd
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
connectd*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database … 162450 files and directories currently installed.)
Removing connectd (2.5.37) …
/usr/bin/connectd_stop_all: 22: .: Can’t open /usr/bin/connectd_options
dpkg: error processing package connectd (–remove):
installed connectd package pre-removal script subprocess returned error exit status 127

================================================================================
Run “sudo connectd_installer” to interactively install remote.it Services on this device.

See https://docs.remote.it for more information.

================================================================================
Errors were encountered while processing:
connectd
E: Sub-process /usr/bin/dpkg returned an error code (1)

  1. Remove remoteit

#apt purge remoteit
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
avahi-utils jq libjq1 libonig5
Use ‘sudo apt autoremove’ to remove them.
The following packages will be REMOVED:
remoteit*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database … 162450 files and directories currently installed.)
Removing remoteit (1.0.14) …
∘ Login with remote.it account
∘ Remove services
∘ UnRegister device ‘’
∘ Remoteit Agent - Stop
∘ Remoteit Agent - Uninstall
∘ Remove dependencies
✓ DONE: remote.it has been removed from your system
Failed to disable unit: Unit file remoteit-headless.service does not exist.
dpkg: error processing package remoteit (–remove):
installed remoteit package pre-removal script subprocess returned error exit status 1
/var/lib/dpkg/info/remoteit.postinst: 11: /var/lib/dpkg/info/remoteit.postinst: /usr/share/remoteit/connectd: not found
dpkg: error while cleaning up:
installed remoteit package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
remoteit
E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems to me that some necessary files are missing. Can someone share his/hers experience and thoughts on how to make a clean installation from scratch (other than building my Pi from the beginning)?

Looking forward for your answers!

Regards

Yeah, sorry about that… there’s an issue - exactly as you’ve noted, when trying to uninstall either package if both are installed. Let me spend some time on this and see if I can come up with a way to force the uninstall.

The first thing I noticed is that you are not using “sudo” with the “apt purge” command. Or at least, it looks that way.

1 Like

Hi Gary!

Thanks for your help.

As for the following:

I have already used “sudo su” so all commands are running as “root”.

Engineer’s suggestion would be to reinstall connectd, then reinstall remoteit, purge remoteit, then purge connectd.

I just tried it here in that order and it worked.

Unfortunately I cannot verify the solution!

Here is what I have done :

  1. Re-Install “connectd” (using the “/var/cache/apt/archives” packages)

#dpkg -i connectd_2.5.37_armhf.deb
(Reading database … 162451 files and directories currently installed.)
Preparing to unpack connectd_2.5.37_armhf.deb …
Unpacking connectd (2.5.37) over (2.5.37) …
Setting up connectd (2.5.37) …

================================================================================
Run “sudo connectd_installer” to interactively install remote.it Services on this device.

See https://docs.remote.it for more information.

================================================================================

  1. Re-Install “remoteit” (using the “/var/cache/apt/archives” packages)
    #dpkg -i remoteit_1.0.14_armhf.deb
    (Reading database … 162451 files and directories currently installed.)
    Preparing to unpack remoteit_1.0.14_armhf.deb …
    Unpacking remoteit (1.0.14) over (1.0.14) …
    Setting up remoteit (1.0.14) …
    you already have the latest connectd version
    installing muxer version 0.3
    you already have the latest remoteit version
    you already have the latest desktop version
    Created symlink /etc/systemd/system/multi-user.target.wants/avahi-alias@remoteit.local.service → /etc/systemd/system/avahi-alias@remoteit.local.service.
    ================================================================================

Continue your device registration at http://find.remote.it
or hxxp://xxxxxx:29999 (removed URL due to forum restrictions)
or hxxp://xxxxxx:29999 (removed URL due to forum restrictions)

================================================================================

  1. Tried to remove “remoteit” with error again (have a look below):

#apt-get remove --purge remoteit
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
avahi-utils jq libjq1 libonig5
Use ‘sudo apt autoremove’ to remove them.
The following packages will be REMOVED:
remoteit*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database … 162450 files and directories currently installed.)
Removing remoteit (1.0.14) …
∘ Login with remote.it account
∘ Remove services
∘ UnRegister device ‘’
∘ Remoteit Agent - Stop
∘ Remoteit Agent - Uninstall
∘ Remove dependencies
✓ DONE: remote.it has been removed from your system
Removed /etc/systemd/system/multi-user.target.wants/avahi-alias@remoteit.local.service.
Failed to disable unit: Unit file remoteit-headless.service does not exist.
dpkg: error processing package remoteit (–remove):
installed remoteit package pre-removal script subprocess returned error exit status 1
installing connectd version 4.8
/var/lib/dpkg/info/remoteit.postinst: 25: /var/lib/dpkg/info/remoteit.postinst: /usr/share/remoteit/muxer: not found
installing muxer version
mv: cannot stat ‘/usr/share/remoteit/muxer’: No such file or directory
mv: cannot stat ‘/usr/share/remoteit/demuxer’: No such file or directory
dpkg: error while cleaning up:
installed remoteit package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
remoteit
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any suggestions now?

OK, I can’t reproduce your failure at the moment, but going on this article -

Please try:

sudo dpkg --purge --force-all connectd

sudo dpkg --purge --force-all remoteit

Unfortunately not…Both of them still fail:

#dpkg --purge --force-all connectd
(Reading database … 162450 files and directories currently installed.)
Removing connectd (2.5.37) …
/usr/bin/connectd_stop_all: 22: .: Can’t open /usr/bin/connectd_options
dpkg: error processing package connectd (–purge):
installed connectd package pre-removal script subprocess returned error exit status 127

================================================================================
Run “sudo connectd_installer” to interactively install remote.it Services on this device.

================================================================================
Errors were encountered while processing:
connectd

#dpkg --purge --force-all remoteit
(Reading database … 162450 files and directories currently installed.)
Removing remoteit (1.0.14) …
∘ Login with remote.it account
∘ Remove services
∘ UnRegister device ‘’
∘ Remoteit Agent - Stop
∘ Remoteit Agent - Uninstall
∘ Remove dependencies
✓ DONE: remote.it has been removed from your system
Failed to disable unit: Unit file remoteit-headless.service does not exist.
dpkg: error processing package remoteit (–purge):
installed remoteit package pre-removal script subprocess returned error exit status 1
/var/lib/dpkg/info/remoteit.postinst: 11: /var/lib/dpkg/info/remoteit.postinst: /usr/share/remoteit/connectd: not found
dpkg: error while cleaning up:
installed remoteit package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
remoteit

Well, let’s try one things at a time. I don’t know how this happened and can’t reproduce the exact scenario here.

Check to see if that file exists, e.g.

ls -l /usr/bin/connectd_options

If it does, remove it forcefully:

sudo rm /usr/bin/connectd_options

and then replace it:

sudo su
cd /usr/bin
wget https://raw.githubusercontent.com/remoteit/installer/master/connectd/usr/bin/connectd_options

That should restore the connectd_options file, which hopefully will allow the purge of the connectd package to proceed.

Then, if purging remoteit continues to complain about:

(as root still)
cd /usr/share/remoteit
wget https://github.com/remoteit/connectd/releases/download/v4.8/connectd.arm-linaro-pi
mv connectd.arm-linaro-pi connectd

Regarding this:

I am looking at suggestions in this article: https://askubuntu.com/questions/438345/how-to-remove-install-a-package-that-is-not-fully-installed

It might be easiest to delete the prerm file.

e.g.
sudo rm /var/lib/dpkg/info/remoteit.prerm

Sorry about all the trouble. Let me know what happens!

Hi Gary!

Indeed everything was a big mess and i don’t really know what has happened.

As you suggested I had to download from github the “connectd_options” and additionally the “oem_settings” since this was failing afterwards!

Then I could remove the “connectd” package.

Following the same methodology I did the same for “remoteit”
First of all I have downloaded the ones that couldn’t be found from github as suggested.
As for the error in “remoteit.prerm” regarding “remoteit-headless.service” what I did was to go in “remoteit.prerm” file and “hashed” the line referring to disablement of “remoteit-headless”.

Then tried the remove (purge) and was able to successfully remove it!

I think everything is now in order but what triggered my curiosity is the following quote from github:

**The easiest way to install remote.it on a Linux system is to run the following on the command line:**

curl -LkO https://raw.githubusercontent.com/remoteit/installer/master/scripts/auto-install.sh
chmod +x ./auto-install.sh
sudo ./auto-install.sh

So what is the recommended way to go? Should we install it using the aforementioned github script or should we follow the procedure described in “remote.it” which is:

sudo apt install remoteit

I had followed the later and ended up in all these kind of troubles…

So what do you think? Which one is less error prone?

Once again thank you very much for your help!!!

Best regards,

G.

There’s a bit of a terminology issue that is potentially confusing.

remote.it with a dot in the middle refers both to our company and product offering.
connectd is a package which delivers remote.it functionality.
remoteit (no dot) is a more recent package which also delivers remote.it functionality.

auto-install.sh installs the older connectd package. It’s the same thing you’d get on recent Raspbian or Raspberry Pi OS releases if you run “apt install connectd”. auto-install.sh (connectd) also supports a wider variety of Linux platforms than remoteit, such as OpenWRT, which are not Debian based. At the moment, remoteit works for Windows, Mac, and Debian based OSes running Arm or Intel/AMD CPUs. connectd does not support Windows or Mac.

The end result is slightly different.

remoteit includes the Web Admin Panel which lets you add or remove services using a browser, whereas using connectd would require you to get to a console (e.g. SSH) and run the connectd_installer package to do the same thing.

connectd supports Bulk and Auto Registration for Mass Production. Auto registration for remoteit is in the works but not ready yet.

connectd has been released and updated for the past 5 years with very few changes in its basic operation (all shell scripts).

remoteit is more recent and works a completely different way. There are some issues, such as the ones you encountered here, that I do not understand how they could have happened.

All that said, I would start again by using the remoteit package by itself, not installed over connectd. If for whatever reason you continue to face any issue, purge remoteit and install connectd. If that’s in fact what you did (installed remoteit and then all these problems happened), then just install connectd.

OK! I see what’s happening here!

I am positive that I have tried using:

sudo apt install remoteit

but not sure though. I vaguely remember that there was a “connectd” requirement and somehow I ended in this mess…(maybe both were installed in the end…)

Anyway, I am willing to try again before going down the “connectd” way but my main concern is that auto registration is not yet available for “remoteit”. Do you have any estimate for that before being into trouble again?

Thanks!