Hi all, .DEB and .RPM packages for openHAB 3 snapshots and milestones (3.0.0.M1) are now available. I’m going to use this space to detail what’s changing and how to use them. If anything changes with the packages I will update this post.
Note for openHABian users: openHABian has a few extra features such as zram that use openHAB 2 specific paths. If you want to try openHAB 3, you should disable ZRAM first and expect that there will be a few things (such as frontail) that will not work as you’d expect. Make sure you’ve used the openHABian backup features before changing anything!
The summary is short and sweet, but you should read the detail
Summary
OH3 packages are available in the same snapshot repository as OH2. If you want to continue using OH2 snapshots (which continue to be built), you will not automatically be forced onto OH3 and therefore you won’t need to do anything. If you do want to install OH3, you’ll need to use a specific command:
sudo apt install openhab
### or ###
sudo yum install openhab
### or ###
sudo dnf install openhab
Detail
Since the OH2 Linux openhab2*
packages used folder names like /etc/openhab2
we used this opportunity to remove the version out of anything the packages provides, including the name of the package itself. Some files such as openhab-cli
didn’t use any version in the naming at all, and therefore haven’t moved anywhere.
Unfortunately, it means that in terms of openHAB 2 and openHAB 3, you cannot install both at the same time and for now openHAB 2 will not automatically update to openHAB 3, but if you use the commands to install openHAB 3 whilst openHAB 2 exists, then the configs will copy across.
Backup first
If you’ve got an existing OH2 installation, back it up before you do anything. openhab-cli backup [filepath]/[filename].zip
will create a zip file which can be used to restore the same version of openHAB later using openhab-cli restore [filepath]/[filename].zip
. Put the file somewhere not related to openHAB, such as your own home directory (e.g. /home/pi/
). You should probably do your usual OS backup too to make sure you can get back to where you left off.
Prerequisites
openHAB 3 requires Java 11. Most modern Linux OS have an openjdk-11-jdk
package available for you to install but alternative solutions such as Zulu’s OpenJDK (which openHABian can install for you) are available and these may run faster on 32-bit armhf platforms such as the Raspberry Pi.
You must also be on the relevant repository for openHAB, this hasn’t changed for openHAB 3.x so the same instructions for moving to it are still valid.
For snapshots, this repository is
deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg unstable main
For milestones, this repository is
deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg testing main
Fresh installation
A fresh installation will make sure you’re clear of any current incompatibilities caused by the upgrade process.
With your backup file clear of any openHAB path, you can use the following commands to get rid of all files related to OH2 and then install OH3. If this is a system without openHAB 2, then just use the update
and install
commands.
After a successful install, you can use commands like sudo systemctl start openhab
(notice no 2
at the end) immediately, but if openhab2
was previously installed then openhab-cli
will complain of path errors until you restart your shell session (e.g. by logging out and in).
APT (Debian / Ubuntu and derivatives)
sudo apt purge openhab2
sudo apt update
sudo apt install openhab
YUM or DNF (RedHat, CentOS, Fedora, etc)
sudo dnf remove openhab2
sudo dnf install openhab
Replace “dnf” with “yum” for older Red Hat based OSes.
Upgrade from openHAB 2
If the install of openHAB 3 detects an existing openHAB 2 install, then it will copy the configurations across and update using those files. There are several major differences between openHAB 2 and 3 which may mean that this will cause issues, let us know if you experience anything strange.
After a successful update, you can use commands like sudo systemctl start openhab
(notice no 2 at the end) immediately, but openhab-cli
will complain of path errors until you restart your shell session (e.g. by logging out and in).
With openhab2
still installed:
APT (Debian / Ubuntu and derivatives)
sudo apt update
sudo apt install openhab
The system will ask you if you want to remove openhab2
as part of this, and you should respond with “y”. After the install continues it will warn you that several of your configuration files have newer versions, mostly your answer to these should be yes to install the maintainer’s versions, take a note of which files these are as the installer will save them in the same location as “.old” files if you want to copy something specific across.
You can get rid of openHAB2 leftover configuration files by using the sudo apt purge openhab2
command, but this also gets rid of the openhab
user, to fix this issue you should follow this with:
sudo apt install --reinstall openhab
sudo openhab-cli reset-ownership
DNF (RedHat, CentOS, Fedora, etc)
sudo dnf --allowerasing install openhab
YUM (Older RedHat, CentOS, Fedora, etc)
The equivalent command (untested) should be:
sudo yum swap openhab2 openhab
Check to see what packages are installed/removed. These should only be openHAB related.
Troubleshooting
If you have trouble connecting to the repo with an error that looks like:
Unknown date format Bad header data [IP: XX.XX.XX.XX 443]
then in place of the install
command, you can use the file directly e.g.:
wget https://openhab.jfrog.io/openhab/list/openhab-linuxpkg/pool/main/3.0.0~S1919/openhab_3.0.0~S1919-1_all.deb
sudo apt install ./openhab_3.0.0~S1919-1_all.deb
For later versions than the example above, the list of versions can be found here.
Issues to look at
Issue | Status | GitHub Link |
---|---|---|
Package suggest s distro openJDK only |
Fixed | #183 |
This post will be updated if anything changes, please feel free to post any questions or comments about the above here!