Guide: Installing and testing OH3 snapshots/milestones using APT and YUM

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 :wink:



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 suggests 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!

25 Likes

Hi Ben,
thanks for posting, but I run into the following Issue :

Unbekanntes Datumsformat Fehlerhafte Kopfzeilendaten [IP: 35.231.52.82 443]
Paketlisten werden gelesen… Fertig
E: Das Depot »https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable Release« enthält keine Release-Datei.
N: Eine Aktualisierung von solch einem Depot kann nicht auf eine sichere Art durchgeführt werden, daher ist es standardmäßig deaktiviert.
N: Weitere Details zur Erzeugung von Paketdepots sowie zu deren Benutzerkonfiguration finden Sie in der Handbuchseite apt-secure(8).

Short english description :
Wrong date format, error in headers, no release file.

I have tried on a fresh Ubuntu 20.4.1 VM running Azul Java11 64bit

Any hint or solution ???

3 Likes

Great work and thanks a lot for your efforts.

I am seeting up a complete new system so no old stuff to save, but i have a problem with the repo. If i understand it right we should use the unstable repo (makes sens to me :-))

if i perform an apt update i get the following

Fehl:6 https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable Release
  Unbekanntes Datumsformat Fehlerhafte Kopfzeilendaten [IP: 35.231.52.82 443]
Paketlisten werden gelesen... Fertig
E: Das Depot »https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable Release« enthält keine Release-Datei.

Translated to english: Wrong dateformat in header data. The depot does not contain a release file and therefor the repo is disabled.

Any idea?

1 Like

I was a minute faster than You :slight_smile:

2 Likes

Unfortunately, this is a known issue that happens intermittently.

If you’re eager to test, you can use the following commands as a workaround.

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
1 Like

Would be good to mention this in your Guide :wink:

3 Likes

Good idea, updated the post and fixed the broken link in my example above (sorry!)

4 Likes

Great! I will definitely try that when I have time.
I think we can put on the tutorial a part like : how to revert to openhab 2.5.x

1 Like

Today it worked :thinking:

1 Like

#metoo

Currently i am digging into the new concepts - until now i like it!

2 Likes

Wait for the new features Yannik is preparing…

4 Likes

I am having an issue with connecting the myopenhab cloud. Looks like its an HTTP 401 error? This is when i try to discover devices from Alexa (via the Openhab cloud onto the Openhab server). Errors are shown in the Openhab log files. Alexa is not able to find any exposed devices.
Note that i am on OH3 snapshot release. I can’t say when this error started but it was working fine on OH 2.5.8 till yesterday. never got it to work on OH3. Is this the right place to post this?

    2020-09-07 18:08:24.964 [WARN ] [io.openhabcloud.internal.CloudClient] - Response Failure: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
    2020-09-07 18:08:25.070 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty request 25049576 failed: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
    2020-09-07 18:08:25.151 [WARN ] [io.openhabcloud.internal.CloudClient] - Response Failure: HTTP protocol violation: Authentication challenge without WWW-Authenticate header

items def is same as in OH2

1 Like

Is there already an installation available for windows?

1 Like

I installed openhab 3, everything went fine, only problem is my jython rules doesn’t work in this new version, I don’t know if it’s a openhab core problem or a problem with the install.
I did not have time to explore why, if someone find the reason? I will explore that later.
(Js rules seems to work just fine, you can see it in the log)

1 Like

Just found a new build with apt update and got the following error while installing it.

openhab (3.0.0~S1922-1) wird eingerichtet ...

[openHAB] Performing post-update tasks for version 3.0.0:
  Replacing: String org.eclipse.smarthome.i18n to org.openhab.i18n in file /var/lib/openhab/config/org/openhab/i18n.config
  Replacing: String org.eclipse.smarthome.persistence to org.openhab.persistence in file /var/lib/openhab/config/org/openhab/persistence.config
  Replacing: String org.eclipse.smarthome.audio to org.openhab.audio in file /var/lib/openhab/config/org/openhab/audio.config
  Replacing: String org.eclipse.smarthome.inbox to org.openhab.inbox in file /var/lib/openhab/config/org/openhab/inbox.config
  Replacing: String org.eclipse.smarthome.folder to org.openhab.folder in file /var/lib/openhab/config/org/openhab/folder.config
  Replacing: String org.eclipse.smarthome.threadpool to org.openhab.threadpool in file /var/lib/openhab/config/org/openhab/threadpool.config
  Replacing: String org.eclipse.smarthome.autoupdate to org.openhab.autoupdate in file /var/lib/openhab/config/org/openhab/autoupdate.config
  Replacing: String org.eclipse.smarthome.lsp to org.openhab.lsp in file /var/lib/openhab/config/org/openhab/lsp.config
  Replacing: String org.eclipse.smarthome.rulehli to org.openhab.rulehli in file /var/lib/openhab/config/org/openhab/rulehli.config
  Replacing: String org.eclipse.smarthome.storage.json to org.openhab.storage.json in file /var/lib/openhab/config/org/openhab/storage/json.config
  Replacing: String org.eclipse.smarthome.storage.mapdb to org.openhab.storage.mapdb in file /var/lib/openhab/config/org/openhab/storage/json.config
  Replacing: String org.eclipse.smarthome.core to org.openhab.core in file /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json
  Replacing: String org.eclipse.smarthome to org.openhab.core in file /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json
  Replacing: String org.eclipse.smarthome.core to org.openhab.core in file /var/lib/openhab/jsondb/org.openhab.core.items.Item.json
  Replacing: String org.eclipse.smarthome to org.openhab.core in file /var/lib/openhab/jsondb/org.openhab.core.items.Item.json
  Replacing: String org.eclipse.smarthome.core to org.openhab.core in file /var/lib/openhab/jsondb/org.openhab.core.thing.Thing.json
  Replacing: String org.eclipse.smarthome to org.openhab.core in file /var/lib/openhab/jsondb/org.openhab.core.thing.Thing.json

dpkg: Fehler beim Bearbeiten des Paketes openhab (--configure):
 »installiertes openhab-Skript des Paketes post-installation«-Unterprozess gab den Fehlerwert 1 zurück

As far as i understand. There is an error in the ost Installation process. a second Apt upgrade went well.

1 Like

Fresh install on Debian, went like a charm.
Will rebuild my system in this snapshot, see what it gives.
New toys :slight_smile:

3 Likes

Hi folks…any feedback on this? debugging the openhabcloud connector on OH3 seems to indicate this is a jetty HttpClient issue. Possibly some sort of error to parse the headers being received from openhabcloud (?). But this happens only with OH3 and Alexa trying to look for the items.

2020-09-08 01:25:16.604 [DEBUG] [io.openhabcloud.internal.CloudClient] - on(): request
2020-09-08 01:25:16.620 [DEBUG] [io.openhabcloud.internal.CloudClient] - Got request 25304275
2020-09-08 01:25:16.629 [DEBUG] [io.openhabcloud.internal.CloudClient] - {"host":"myopenhab.org","cache-control":"no-cache","accept-encoding":"gzip, deflate","accept":"application/json","user-agent":"openhab-cloud/0.0.1"}
2020-09-08 01:25:16.639 [DEBUG] [io.openhabcloud.internal.CloudClient] - Request method is GET
2020-09-08 01:25:16.648 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header host = myopenhab.org
2020-09-08 01:25:16.656 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header cache-control = no-cache
2020-09-08 01:25:16.665 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept-encoding = gzip, deflate
2020-09-08 01:25:16.674 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept = application/json
2020-09-08 01:25:16.687 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header user-agent = openhab-cloud/0.0.1
2020-09-08 01:25:16.710 [DEBUG] [io.openhabcloud.internal.CloudClient] - on(): request
2020-09-08 01:25:16.748 [DEBUG] [io.openhabcloud.internal.CloudClient] - Got request 25304277
2020-09-08 01:25:16.795 [DEBUG] [io.openhabcloud.internal.CloudClient] - {"host":"myopenhab.org","cache-control":"no-cache","accept-encoding":"gzip, deflate","accept":"application/json","user-agent":"openhab-cloud/0.0.1"}
2020-09-08 01:25:16.815 [DEBUG] [io.openhabcloud.internal.CloudClient] - Request method is GET
2020-09-08 01:25:16.852 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header host = myopenhab.org
2020-09-08 01:25:16.872 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header cache-control = no-cache
2020-09-08 01:25:16.932 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept-encoding = gzip, deflate
2020-09-08 01:25:16.962 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept = application/json
2020-09-08 01:25:16.972 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty finished receiving response header
2020-09-08 01:25:16.994 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header user-agent = openhab-cloud/0.0.1
2020-09-08 01:25:17.000 [DEBUG] [io.openhabcloud.internal.CloudClient] - Sent headers to request 25304275
2020-09-08 01:25:17.027 [DEBUG] [io.openhabcloud.internal.CloudClient] - {"headers":{"Transfer-Encoding":"chunked","Server":"Jetty(9.4.20.v20190813)","Content-Encoding":"UTF-8","Date":"Mon, 07 Sep 2020 19:55:16 GMT","Content-Type":"application/json"},"responseStatusCode":401,"responseStatusText":"OK","id":25304275}
2020-09-08 01:25:17.065 [DEBUG] [io.openhabcloud.internal.CloudClient] - on(): request
2020-09-08 01:25:17.081 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty received response content of size 65
2020-09-08 01:25:17.104 [DEBUG] [io.openhabcloud.internal.CloudClient] - Got request 25304278
2020-09-08 01:25:17.121 [DEBUG] [io.openhabcloud.internal.CloudClient] - Sent content to request 25304275
2020-09-08 01:25:17.133 [DEBUG] [io.openhabcloud.internal.CloudClient] - {"host":"myopenhab.org","cache-control":"no-cache","accept-encoding":"gzip, deflate","accept":"application/json","user-agent":"openhab-cloud/0.0.1"}
2020-09-08 01:25:17.152 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty request 25304275 failed: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2020-09-08 01:25:17.161 [DEBUG] [io.openhabcloud.internal.CloudClient] - Request method is GET
2020-09-08 01:25:17.172 [WARN ] [io.openhabcloud.internal.CloudClient] - Response Failure: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2020-09-08 01:25:17.186 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header host = myopenhab.org
2020-09-08 01:25:17.204 [DEBUG] [io.openhabcloud.internal.CloudClient] - Finished responding to request 25304275
2020-09-08 01:25:17.216 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header cache-control = no-cache
2020-09-08 01:25:17.244 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept-encoding = gzip, deflate
2020-09-08 01:25:17.253 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept = application/json
2020-09-08 01:25:17.271 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header user-agent = openhab-cloud/0.0.1
2020-09-08 01:25:17.482 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty finished receiving response header
2020-09-08 01:25:17.505 [DEBUG] [io.openhabcloud.internal.CloudClient] - Sent headers to request 25304278
2020-09-08 01:25:17.534 [DEBUG] [io.openhabcloud.internal.CloudClient] - {"headers":{"Transfer-Encoding":"chunked","Server":"Jetty(9.4.20.v20190813)","Content-Encoding":"UTF-8","Date":"Mon, 07 Sep 2020 19:55:17 GMT","Content-Type":"application/json"},"responseStatusCode":401,"responseStatusText":"OK","id":25304278}
2020-09-08 01:25:17.554 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty received response content of size 65
2020-09-08 01:25:17.602 [DEBUG] [io.openhabcloud.internal.CloudClient] - Sent content to request 25304278
2020-09-08 01:25:17.639 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty request 25304278 failed: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2020-09-08 01:25:17.677 [WARN ] [io.openhabcloud.internal.CloudClient] - Response Failure: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2020-09-08 01:25:17.714 [DEBUG] [io.openhabcloud.internal.CloudClient] - Finished responding to request 25304278
2020-09-08 01:25:17.771 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty finished receiving response header
2020-09-08 01:25:17.803 [DEBUG] [io.openhabcloud.internal.CloudClient] - Sent headers to request 25304277
2020-09-08 01:25:17.842 [DEBUG] [io.openhabcloud.internal.CloudClient] - {"headers":{"Transfer-Encoding":"chunked","Server":"Jetty(9.4.20.v20190813)","Date":"Mon, 07 Sep 2020 19:55:17 GMT","Content-Type":"application/json"},"responseStatusCode":200,"responseStatusText":"OK","id":25304277}
2020-09-08 01:25:17.864 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty received response content of size 1257
2020-09-08 01:25:17.887 [DEBUG] [io.openhabcloud.internal.CloudClient] - Sent content to request 25304277
2020-09-08 01:25:17.943 [DEBUG] [io.openhabcloud.internal.CloudClient] - Finished responding to request 25304277
1 Like

Might be related to this PR

3 Likes

Reverting to openHAB 2 from 3 might be difficult. It might be best at that point to rely on your backup.

Not a self install package as far as I know. But the standalone .zip download should work on Windows machines: (https://ci.openhab.org/job/openHAB3-Distribution/lastSuccessfulBuild/artifact/distributions/openhab/target/openhab-3.0.0-SNAPSHOT.zip)

Depends on the errors you get in the logs, if the install ported these across there might be a few files that still have a few openHAB 2 references but it’s most likely to be a core issue rather than a packaging one.

Was that the only information it gave you? I’ll take a look but there’s definitely something that needs fixing there.

Looks like @hmerk might have the right PR and I think https://github.com/openhab/openhab-cloud/pull/307 also might need to be merged in order for the cloud connector to work with OH3.

2 Likes

Hi,

I installed openhab 3 on my raspberry via the .deb file (i downloaded the 1919 version)
How can i update openhab now to the newer version?

When i try: sudo apt-get upgrade openhab
I get following output:

openhab is already the newest version (3.0.0~S1919-1)

1 Like