Installing Home Assistant Supervised on a Raspberry Pi using Debian 12

This worked great! thanks

Apologies… I had gotten frustrated and restored a backup. I just went back to this and still get the same issues on a new try.

deb http://deb.debian.org/debian/ bookworm main non-free
deb-src http://deb.debian.org/debian/ bookworm main

deb http://security.debian.org/debian-security bookworm-security main non-free
deb-src http://security.debian.org/debian-security bookworm-security main

# bullseye-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_                                         and_backports
deb http://deb.debian.org/debian/ bookworm-updates main non-free
deb-src http://deb.debian.org/debian/ bookworm-updates main
Python 3.11.2

apt.conf is not available.
Edit: The issue seems to stem specifically from py3clean:

Preparing to unpack .../python3-debian_0.1.49_all.deb ...
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/python3/debpython/files.py", line 54, in from_package
    stdout = str(stdout, 'utf-8')
             ^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 6: invalid start byte
dpkg: warning: old python3-debian package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/python3/debpython/files.py", line 54, in from_package
    stdout = str(stdout, 'utf-8')
             ^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 6: invalid start byte
dpkg: error processing archive /var/cache/apt/archives/python3-debian_0.1.49_all.deb (--unpack):
 new python3-debian package pre-removal script subprocess returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/py3compile", line 323, in <module>
    main()
  File "/usr/bin/py3compile", line 302, in main
    compile(files, versions,
  File "/usr/bin/py3compile", line 185, in compile
    for fn, versions_to_compile in filter_files(files, e_patterns, versions):
  File "/usr/bin/py3compile", line 128, in filter_files
    for fpath in files:
  File "/usr/share/python3/debpython/files.py", line 71, in filter_public
    for fn in files:
  File "/usr/share/python3/debpython/files.py", line 54, in from_package
    stdout = str(stdout, 'utf-8')
             ^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 6: invalid start byte
dpkg: error while cleaning up:
 installed python3-debian package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/python3-debian_0.1.49_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Note that the error also occurs when directly connected (local terminal), not just via SSH.

Okay, I seem to have figured it out. This is actually caused by an issue in Ubuntu with different locales, but also affects my system for some reason.
I ended up manually applying the changes listed here and it fixed it. The file to edit is /usr/share/python3/debpython/files.py - just note that it differs slightly from the linked one, but the same additions/changes will work.

So you installed HA Supervised on Ubuntu? :thinking:

No, I installed it on Debian. But the only mention of a similar issue I found was for Ubuntu, and the same fix transferred successfully to Debian.

1 Like

An absolutely Amazing guide! Thank you so much I appreciate it very much…

2 Likes

@Tamsy Million thanks for the upgrade guide, used successfully on Chinese NUC was running HA (in docker) + Supervisor on Debian 11 - now after upgrade running Debian 12. (All went smooth as butter, update took around 15 min overall)

1 Like

when I execute the command ‘dpkg -i homeassistant-supervised.deb’ the system responds with a series of errors:
Cattura

Are there any special reasons to install HA Supervised?

As stated in many places regarding the HA Supervised installation method:

This installation method is considered advanced and should only be used if one is an expert in managing a Linux operating system, Docker and networking!

Maybe you should reconsider and choose the Home Assistant Operating System (HA OS) instead?

However, running:

sudo apt install bluez cifs-utils nfs-common

before "dpkg -i homeassistant-supervised.deb" should do the trick.

thank you for your answer.
I tried to install bluez, but it seems it depends on several other installations.
The response of the system:
Cattura1

Exactly what distro are you using?

Debian 12.9, but I think it’s time to take your suggestion and go back to HASSOS :+1:

3 Likes

Obiviously you did not strictly follow the OP’s guide. Else you have already done this when reaching paragraph 2.1):

Furthermore you did this all as the root user where on the guide it is clearly stated to continue the installation as the unprivileded user you should have created the step before but get temporary root only by running sudo -i:

You should certainly do yourself a favor and go back to HA OS :+1:t3:

2 Likes

:+1: :blush: :wink: Thanks!

After all the suffering, finally a solution that works! Thank you!