Installing OH2 on Openhabian

I attempted a failed upgrade and need to reinstall OH2 and would like to do this on openhabian. I can’t find any information on how to do this. I see in openhabian.conf there is a repositoryurl and clonebranch. I think I’m in the right place here but the only options I’m finding is setting clonebranch to stable? Is there a particular repository for OH2? Or perhaps I’m way off and someone can help shed some light.

I’ve tried installing Openhabian1.7 and setting OH2 and the install option but once it was finished it installed OH3…

My pi3 running OH2 is supporting onewire with 7 ds18b20 sensors and 8 channel relay as a thermostat to control a radiant heating system. Everything worked great until I didn’t take the necessary precautions as a backup and test before I upgraded. Now with the newer pigpio and all the other errors, I’m starting from scratch but just want to get my pi back up while I take a more careful approach moving to OH3.

As an update, I also came across this post, that says it’s fixed but not sure exactly where. Does this mean if I use Openhabian 1.6 and set the clonebranch to stable it will install OH2?

https://issueexplorer.com/issue/openhab/openhabian/1594#google_vignette

Any help is appreciated.

Thanks in advance

This is what you get running openhabian-config menu:

You are currently using the "openHAB3" openHABian environment version.                 

The openHABian version to contain the very latest code for openHAB 3 is called "main". 
This is providing you with the latest (openHAB3!) features but less people have tested 
it so it is a little more likely that you run into errors.                            
You can step back a little and switch to use the stable version now called "openHAB3".
You can switch at any time by selecting this menu option again or by setting the       
'clonebranch=' parameter in '/etc/openhabian.conf'.                                   

 (*) openHAB3  recommended standard version of openHABian (openHAB 3)               
 ( ) main      very latest version of openHABian (openHAB 3)                        
 ( ) stable    old version of openHABian (openHAB 2)

Setting clonebranch to stable will select OH2 repository and install OH2.

There is something else going on. the install never completes. it looks as though there is a problem with the repository keyring on jfrog

E: Conflicting values set for option Signed-By regarding source https://openhab.jfrog.io/artifactory/openhab-linuxpkg/ stable: /usr/share/keyrings/openhab.gpg != 
E: The list of sources could not be read.
FAILED (update apt lists)

BTW, this is using Openhab 1.6.6 as noted in github. Will setting the clonebase=stable in Openhabian 1.7.7 work for installing OH2.5? Honestly, the openhabian-config menu option is confusing, there are many options to install and upgrade and nothing specific states it’s specific to the clonebranch or an override of sorts. my 2cents anyway

What does

grep artifactory /etc/apt/sources.list.d/*

return ?

And what does

ls /usr/share/keyrings/

show ?

I’ve tried both Ohabian 1.6.6 and 1.7.1 and both write two apt source files openhab.list and openhab2.list though I’m seeing more errors with 1.7.1

grep artifactory /etc/apt/sources.list.d/*
/etc/apt/sources.list.d/openhab.list:deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main
/etc/apt/sources.list.d/openhab2.list:deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main
ls /usr/share/keyrings/
comitup.gpg  nodejs.gpg  openhab.gpg  raspbian-archive-keyring.gpg

and…

sudo apt update
Hit:1 http://davesteele.github.io/comitup/repo comitup InRelease
Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease                     
Hit:3 http://raspbian.raspberrypi.org/raspbian bullseye InRelease                                                              
Hit:4 https://deb.nodesource.com/node_12.x bullseye InRelease                                                                  
Hit:5 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease                         
Err:1 http://davesteele.github.io/comitup/repo comitup InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0959C4A3DCF89FBF
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://davesteele.github.io/comitup/repo comitup InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0959C4A3DCF89FBF
W: Failed to fetch http://davesteele.github.io/comitup/repo/dists/comitup/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0959C4A3DCF89FBF
W: Some index files failed to download. They have been ignored, or old ones used instead.

Remove one of the files that list jfrog. This is ok as they contain the same content.

With regard to

you need to follow the instructions at Comitup | Bootstrap WiFi networking using the WiFi connection to import the public key. According to Corrupt installation after updating from 3.1 (M5) to 3.2.M4 that might not work. If that is the case you need to contact the owner of that repository.
To check if OH installation works you could temporarily remove the davesteele repo from the sources.list.d directory and do

sudo apt update

Folks, installing into OH2 is no longer supported. That means it used to work some (long) time ago but maintainers no longer maintain that so if it no longer works you’re on your own from here on.
Please read and follow the debug guide. Among other stuff it tells you how to re-start an installation (which is how you should proceed after you delete or correct a repo file).

Thank you Markus, Theoritically, I read that openhabian is just Raspbian Lite with custom scripts to maintain the working environment for Openhab. Do you see any issue installing the 2.5 deb package locally, downloaded from JFrog? I can remove the repositories and keep the openHABian-install in place not to attempt unattended installation? or would you recommend not using Openhabian at and approach this as a totally manual installation on Raspbian Lite?

… but the same document also states:

The image will install openHAB 3 by default, to have it install openHAB 2 right from the beginning, set clonebranch=stable in openhabian.conf before first boot.

Yes. Why “but” ? That’s no contradiction, isn’t it.

Why do you want to complicate things?
Just delete the repo and repeat/continue your installation as I suggested.

Alternatively, you can install stock OH3 then use menu 42 to downgrade to OH2.