Skip to main content

Notes, Dependencies & Install

This install is pretty quick and easy.  But there was a couple items I wanted to fix after my first run. Instead of trying to remember what the hell I did, I figured I should jot it down.  Honestly I really wanted to try and get the "Supervised" version installed so I had easy access to the addons and updates. But oh no! The HA team apparently just want to work with Debian OS's and decided to not give two shits about us RedHat driven folks.  So they ripped out all their scripts that would have worked, and just left a Debian package load.

This should also be a note to anyone reading this.  If you need support, you will be looking for answers in a collection of OLD ass information.  The HA team has no issues with just changing their product to bleeding edge code and components, and breaking it for everyone.  They also do not have issues with not responding to anyone.  This also has the drawback of making all fixes and documentation out their (including their own) obsolete.  So I say...  know your craft, get creative, and figure that shit out yourself.  If your building your system around someone else's well documented instructions.  Be sure to read it well, and make sure any links that they reference still work.  Most do not.  And also note that it is not the person that wrote the doc's fault.  Just like this write up, it may be broken tomorrow!  All I can hope for is that the basics still apply and we can fish our way through to a good install.

Ok.  Let me get this ball rolling.

 

Install Rocky Linux

This part is on you.  I personally always start with a Minimal install, and remove any of the additional package groups that are selected.  The additional packages include a bunch of tools and one of them is Cockpit.  Cockpit is very cool don't get me wrong. But it's overkill for most of my needs. In addition it needs secured, being that it is an interface into your system.  So that means it will also need to install all the web, and security features that it requires.  Really nice, BUT... it's bloat.  These packages can all be installed quite easily later using dnf / yum.

A additional note I would like to make is that I am not going to get into locking down the system.  I use IPTables (verses Firewalld).  I know IPTables, and it's easyeasier for me.  Also I will not be getting into SELinux.  SELinux is like Debians AppArmor.  It's a good idea.  But I have other means of locking my systems away from the outside (router with nat, firewall, reverse proxy, ipset, fail2ban, iptables, ssh keys, and some good wholesome paranoia), and I don't want the complexity SELinux bightingbiting me in the ass when I'm home just screwing around on my machines or trying to figure something out.  So, your going to just get the stuff I did to install this software.  If your going to allow access to your system outside your network, then I implore you to LOCK YOUR SHITIT DOWN!

 

Some Dependencies and Pre-Work

Home Assistant is deprecating versions of certain software that comes with Rocky Linux 8 / CentOS 8, and there is not a way to get to the versions they require by using the main repositories including epel.  I am sure that someone perhaps has created some packages and hosts a repo, but I have found that installing these couple pieces of software from source was the way to go, and is well documented.  I like keeping my systems rpm based, but sometimes I have to give.

In order to make things install and work smoothly we are going to install updated copies of SQLite and Python along side the existing software.  But we will keep those loads in /usr/local so they are easily upgraded or removed later if needed.

Here are some packages that I loaded initially into my new Rocky Linux build.

# Installing some basics and deps

dnf install yum-utils

dnf install dnf-plugins-core
dnf install epel-release
dnf config-manger --add-repo=https://negativo17.org/repos/epel-multimedia.repo
dnf config-manager --set-enabled powertools
dnf groupinstall "Development Tools"

dnf update

dnf install attr bind-utils bzip2-devel expat-devel ffmpeg ffmpeg-devel \
gcc gcc-c++ gdbm-devel ipset ipset-service iptables iptables-services \
jq jq-devel libffi-devel libseccomp libseccomp-devel libuuid-devel \
logrotate make mlocate ncurses-devel net-tools openssl-devel \
p7zip p7zip-plugins readline-devel rsyslog sqlite-devel systemd-devel \
tar tk-devel turbojpeg turbojpeg-devel tzdata unzip \
vim-common vim-enhanced wget xz-devel zlib-devel

# NOTE: Some of these should be installed already by default.  But I found that if I don't just try
# and install again, I am shooting myself in the foot.  We will just call it... not being complacent.

 

 SQLite 3.37.2  (at the time of this write up)

We are going to start with SQLite.  We need to have the upgraded SQLite in place so that we can compile it into the new Python install.  You can do Python first, but I found that this method worked well for me, I didn't have to jump through hoops to make it work.

Home Assistant is moving to version 3.31 or better.  So installing a higher version now will hopefully save a headache later.  We want to grab the source autoconf tar.gz file.  Verify the file name your pulling down and update the commands below.

Check the current version on the system.

   /usr/bin/sqlite3 --version
   3.26.0 2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238alt1

# Download, Build, Install

cd /opt

wget https://www.sqlite.org/2022/sqlite-autoconf-3370200.tar.gz
tar -xzf sqlite-autoconf-3370200.tar.gz 
chown -R root.root sqlite-autoconf-3370200

cd sqlite-autoconf-3370200
./configure
make
make install

cd /opt

Now lets check the version on the new install.  It should also be part of the environment now too, so we will check both ways.

  sqlite3 --version
  3.37.2 2022-01-06 13:25:41 872ba256cbf61d9290b571c0e6d82a20c224ca3ad82971edc46b29818d5d17a0

  /usr/local/bin/sqlite3 --version
  3.37.2 2022-01-06 13:25:41 872ba256cbf61d9290b571c0e6d82a20c224ca3ad82971edc46b29818d5d17a0

At the end of the install it will have spit out some jargon in regards to where the library files were installed.  Note this for later. 

/usr/local/lib

Ok.  That's done.  Next!

 

 Python 3.9.10 (at the time of this write up)

Now we will install Python and link it to the SQLite library above.  Go get the gzipped source tarball from Python.  Again check the file name you are downloading and update the commands below.

https://www.python.org/downloads/source/

And here we go...

# Download, Build, Install

cd /opt

wget https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz
tar xf Python-3.9.10.tgz
chown -R root.root Python-3.9.10

cd Python-3.9.10

# This may take a little while because of the "optimizations" being enabled.  But it's worth it (they say).
LD_RUN_PATH=/usr/local/lib ./configure --with-ensurepip=install --enable-optimizations
LD_RUN_PATH=/usr/local/lib make
LD_RUN_PATH=/usr/local/lib make altinstall

cd /usr/local/bin
ln -s python3.9 python3
ln -s python3.9 python
ln -s pip3.9 pip3
ln -s pip3.9 pip

cd ~

Now check the SQLite version that was compiled in.

python3 -c "import sqlite3; print(sqlite3.sqlite_version)"
3.37.2

We are golden!

 

Installing Home Assistant Core