home-assistant / supervised-installer

Installer for a generic Linux system
Apache License 2.0
1.69k stars 583 forks source link

missing package dependency: systemd-resolved #360

Open dothebart opened 5 months ago

dothebart commented 5 months ago

Describe the issue you are experiencing

the debian package invokes systemctl enable systemd-resolved.service however, it needs to pre-depend on it to warrant its available.

It also seems, as bluetooth support only comes alive once bluez is installed on the host, could also be considered a dependency then.

What type of installation are you running?

Home Assistant Supervised

Which operating system are you running on?

Debian

Steps to reproduce the issue

dpkg --pending --configure 
Setting up homeassistant-supervised (1.7.0) ...
+ BINARY_DOCKER=/usr/bin/docker
+ DOCKER_REPO=ghcr.io/home-assistant
+ SERVICE_DOCKER=docker.service
+ SERVICE_NM=NetworkManager.service
+ URL_CHECK_ONLINE=checkonline.home-assistant.io
+ URL_VERSION=https://version.home-assistant.io/stable.json
++ curl -s https://version.home-assistant.io/stable.json
++ jq -e -r .supervisor
+ HASSIO_VERSION=2024.03.1
+ URL_APPARMOR_PROFILE=https://version.home-assistant.io/apparmor.txt
+ info 'Reload systemd'
+ echo -e '\e[32m[info] Reload systemd\e[39m'
[info] Reload systemd
+ systemctl daemon-reload
+ info 'Restarting NetworkManager'
+ echo -e '\e[32m[info] Restarting NetworkManager\e[39m'
[info] Restarting NetworkManager
+ systemctl restart NetworkManager.service
++ stat -c %a /etc/systemd/resolved.conf
+ '[' 644 '!=' 644 ']'
+ info 'Enable systemd-resolved'
+ echo -e '\e[32m[info] Enable systemd-resolved\e[39m'
[info] Enable systemd-resolved
+ systemctl enable systemd-resolved.service
dpkg: error processing package homeassistant-supervised (--configure):
 installed homeassistant-supervised package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 homeassistant-supervised

Anything in the Supervisor logs that might be useful for us?

xx

System Health information

xx

Supervisor diagnostics

xx

Additional information

please add the dependency.

agners commented 5 months ago

Moved to the Supervisor installer repositiory, as the deb is maintained in this repository.

FWIW, the dependency is listed in the installation instructions of the readme. I guess it (/all of them) could also be added to the deb, but maybe there are reasons this isn't being done? :thinking:

@ikifar2012, you probably know better :sweat_smile:

dothebart commented 5 months ago

It already has quiet a bunch. bluez should be considered as well. systemd-resolved is a pre-dependency pre-depends , it needs to be readily set up in order for the scripts to work.

ikifar2012 commented 5 months ago

Thanks for bringing this to my attention, I will definitely add bluez I completely forgot about it, I don't use Bluetooth so I guess I mistakenly forgot about adding the package

I am trying to figure out what packages should be part of the pre-depends, it seems a lot of them should be except for nfs-common, cifs-utils and bluez which I would list as regular dependency's. What are your thoughts on this?

dothebart commented 5 months ago

Hm, I think only resolved got in my way because this was completely missing, and I downloaded the other ones beforehand. But if the script invokes binaries installed from them, it should be in the pre-depends.

Liam-Whiteside commented 5 months ago

@ikifar2012 I've just re-installed the homeassistant-supervised package (on Ubuntu 22.04) and as part of the install it included this

The following NEW packages will be installed
  cifs-utils

However the next time I ran apt upgrade it tried to uninstall it...

The following package was automatically installed and is no longer required:
  cifs-utils
Use 'apt autoremove' to remove it.

So I assume there's an issue with how it's specified as a dependancy? Unsurprisingly without it the network storage using CIFS doesn't work. For now I've just run sudo apt install cifs-utils So it's now marked as manually installed so hopefully won't get removed.

dothebart commented 5 months ago

You can check which packages depend on it like this:

apt-cache rdepends cifs-utils
cifs-utils
Reverse Depends:
  smb4k
  homeassistant-supervised
  smbclient
  udevil
  clonezilla
  smbclient
  libpam-mount
  kwartz-client
  freeipa-client-samba
  education-networked-common
  education-common

probably that dependency went missing?

Liam-Whiteside commented 5 months ago

Yes, looks like the homeassistant-supervised didn't stick. I ran sudo apt install ./homeassistant-supervised.deb then almost immediately sudo apt upgrade so I'm not sure why.

apt-cache rdepends cifs-utils
cifs-utils
Reverse Depends:
  smb4k
  smbclient
  smbclient
  casper
  smbclient
  libpam-mount
  casper
  udevil
  clonezilla
  kwartz-client
  freeipa-client-samba
ikifar2012 commented 4 months ago

@ikifar2012 I've just re-installed the homeassistant-supervised package (on Ubuntu 22.04) and as part of the install it included this

The following NEW packages will be installed
  cifs-utils

However the next time I ran apt upgrade it tried to uninstall it...

The following package was automatically installed and is no longer required:
  cifs-utils
Use 'apt autoremove' to remove it.

So I assume there's an issue with how it's specified as a dependancy? Unsurprisingly without it the network storage using CIFS doesn't work. For now I've just run sudo apt install cifs-utils So it's now marked as manually installed so hopefully won't get removed.

Not sure why this happened... that being said Ubuntu is not officially supported

ikifar2012 commented 3 months ago

Take a look at the latest release, I added BlueZ and moved some Dependency's to Pre-Depends

litinoveweedle commented 1 month ago

Take a look at the latest release, I added BlueZ and moved some Dependency's to Pre-Depends

I would rather keep BlueZ as optional / suggested package, as many people run the supervised on the servers - with no need to populate system by Bluez, Alsa, Pulse audio etc. - simple unnecessary packages on the server HW altogether.

Please do not follow the old Nabu Casa story with supervised, where such changes were made on the user behalf for the greater good. ;-) I would still like to have my freedom to decide if I need Bluetooth support on the HW without Bluetooth. Thank you for reconsideration.

dothebart commented 1 month ago

If there is a mechanism that adds these packages once you select bluetooth to be used, I'd be on your side. If not, having to find out and manually installing is definitely the opposite of what one expects.

litinoveweedle commented 1 month ago

To my knowledge that device is called docs and brain. Home Assistant doesn't require Bluetooth to start and/or run. The same for NetoworkManager. This is not real binary dependency, as so far I was happily running my installation without one or the other.

Creating artificial dependency, just because users might need to run BlueZ and/or NetworkManager is against the way package dependencies work. Such packages shall be in the suggested packages, not in the required ones.

Please refer to: https://www.debian.org/doc/debian-policy/ch-relationships.html

You can clearly make the change in the documentation, where installation of the prerequisite packages is clearly mentioned. So just amending this documentation about cases using Bluez and NetworkManager would be required. I can prepare PR for this if you would agree. Thank you.