Use apt-get commands

Tags: #<Tag:0x00007f326cac4310>

Hi, I’m new to Home Assistant, so please bear with me. I have HassOS running on my Raspberry Pi, and I am trying to install some integrations that are not available from the web UI, for example the Apple TV, or Bluetooth integrations. They require me to run some initial apt-get commands to install some packages, but the commands don’t work because apt-get is not installed. Is there a way I could get apt-get to work on HassOS, or is there another way I could install the packages?

You cannot install packages for Home Assistant OS and you shouldn’t need to install any packages to use any of the built-in integrations. Have you tried to use the integrations without installing additional packages?

Actually, I haven’t. I’ll try that

Please report back with your results. If the Docs are misleading they should be updated. If your willing to do the updates see the link below with how. If you are not, post the results and myself or someone else can make the updates.

In fact you can install packages in home assistant OS. The package manager uses the command apk add xxxx

First create bash script and make executable and put it in a shell command

shell_command: 
setup: /config/scripts/setup.sh
# setup. sh

#!/bin/sh
apk update
apk add -u busybox
apk add busybox-extras
apk add expect
apk add sshpass

Then create an automation that runs your shell command during startup

- id: hass_1
  initial_state: 'true'
  alias: System Startup Notification
  trigger:
    platform: homeassistant
    event: start
  action:
  - service: shell_command.setup
1 Like

That is not the OS, that is inside the homeassistant container

True that’s where home assistant is running as docker on top of home assistant OS.

In this way the packages that are not by default avaliable can be installed and used with home assistant.

Every use case is different… in my case telnet client and expect for scripting is not avaliable by default hence the above proposed solution.