Completely removing home assistant supervised from ubuntu

I am trying to get rid of my home assistant supervised installation from ubuntu, have having difficulty completely getting rid of it. Steps so far
stop the docker containers
remove docker containers
remove docker images - including all the previous ones.
stop the supervisor and AppArmor services
disable the supervisor and AppArmor services
delete the supervisor and AppArmor services.

At this point, any kind of apt operation that results in a restart of docker appears to attempt to reinstall the supervisor and its startup scripts in addition to trying to ping home-assistant.io.

Here is a specific example when trying to update the utterly unrelated Bluetooth support…

sudo apt-get install -y broadcom-wifibt-firmware
Reading package lists... Done
Building dependency tree
Reading state information... Done
broadcom-wifibt-firmware is already the newest version (1.4).
The following packages were automatically installed and are no longer required:
  libfprint-2-tod1 libllvm9
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 128 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up homeassistant-supervised (1.1.1) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
[info] Restarting NetworkManager
[info] Restarting docker service
PING version.home-assistant.io (104.26.5.238) 56(84) bytes of data.
64 bytes from 104.26.5.238 (104.26.5.238): icmp_seq=1 ttl=54 time=17.9 ms

--- version.home-assistant.io ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 17.872/17.872/17.872/0.000 ms
[info] Install supervisor Docker container
[info] Install supervisor startup scripts
sed: can't read /usr/sbin/hassio-supervisor: No such file or directory
dpkg: error processing package homeassistant-supervised (--configure):
 installed homeassistant-supervised package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 homeassistant-supervised
E: Sub-process /usr/bin/dpkg returned an error code (1)

There is obviously something I missed. Any suggestions?

1 Like

That’s because there’s a system service running, called hassio-supervisor, who’s job it is to do exactly that. Try the following command to verify that:

systemctl status hassio-supervisor

You should get an output like:

 hassio-supervisor.service - Hass.io supervisor
     Loaded: loaded (/etc/systemd/system/hassio-supervisor.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2023-08-16 17:36:07 CEST; 1h 23min ago
    Process: 1861 ExecStartPre=/usr/bin/docker stop hassio_supervisor (code=exited, status=0/SUCCESS)
   Main PID: 1867 (docker)
      Tasks: 7 (limit: 3931)
        CPU: 585ms
     CGroup: /system.slice/hassio-supervisor.service
             └─1867 docker container wait hassio_supervisor
  1. First stop, disable and remove the hassio-apparmor, and hassio-supervisor service:
sudo systemctl stop hassio-apparmor.service hassio-supervisor.service
sudo systemctl disable hassio-apparmor.service hassio-supervisor.service

sudo rm /etc/systemd/system/hassio-supervisor.service
sudo rm /etc/systemd/system/hassio-apparmor.service

sudo systemctl daemon-reload
sudo systemctl reset-failed
  1. Stop and remove all running docker containers:
# IMPORTANT: If you're running other docker containers that you DONT want to lose you will need to change the line below to remove ONLY the home assistant docker containers

sudo docker kill $(sudo docker ps -q) && sudo docker rm $(sudo docker ps -a -q)
  1. Remove the hassio installation directory:
# /usr/share/hassio is the default install location
sudo rm -rf /usr/share/hassio
  1. Remove hassio-apparmor, hassio-supervisor and ha binaries:
sudo rm /usr/sbin/hassio-apparmor
sudo rm /usr/sbin/hassio-supervisor
sudo rm /usr/bin/ha
3 Likes