Replacement of the Apt Snapshot Repository

I want to make sure I’m doing this switch over right. My initial install of OpenHAB was by apt-get using the snapshot Online version(Bindings are not stored on my computer). So I should issue the following commands to change over to the new repository and update openhab:

echo 'deb http://dl.bintray.com/openhab/apt-repo2 unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -

Now once I do that do I have to use this command:

sudo apt-get install -t unstable openhab-online

or the normal commands I use to update:

sudo apt-get update
sudo apt-get upgrade

HI @MikeH,
Once you have executed this:

this will suffice

2 Likes

just to be sure. I’m using openHAB2 with openHABian. It should also work this way, I think?

  1. replacing the sources with the “unstable repo2” and signing them
  2. apt-get update && upgrade works now with the new server

right?

I’m on #677 right now, and want to stay on the unstable-branch until official releases.

Yup that should work for you too.
Here a little more info to the syntax that @Udo_Hartmann used: https://wiki.debian.org/AptPreferences
just in case you were wondering…Udo’s solution addressed a more specific use case (those that are on stable or beta releases and want to install the unstable branch anyway).

1 Like

Sounds about right. For everyone else on openHABian: I’ll add the needed changes this evening.

Just for reference: If you see the following error, it’s about time to follow the instructions posted above.

Err https://openhab.ci.cloudbees.com  Packages
  HttpError404
Get:53 https://openhab.ci.cloudbees.com  Packages [369 B]
Err https://openhab.ci.cloudbees.com  Packages
  HttpError404
Fetched 9,105 kB in 21s (429 kB/s)
W: Failed to fetch https://openhab.ci.cloudbees.com/job/openHAB-Distribution/ws/distributions/openhab-offline/target/apt-repo/Packages  HttpError404

W: Failed to fetch https://openhab.ci.cloudbees.com/job/openHAB-Distribution/ws/distributions/openhab-online/target/apt-repo/Packages  HttpError404

E: Some index files failed to download. They have been ignored, or old ones used instead.
1 Like

Hi, I always just downloaded and extracted the latest offline snapshot artifact from cloudbees. Where are the artifacts built now? I can only see the betas on Bintray…

Christian

The snapshot artifacts can be found in the same place in cloudbees but openhab-offline is missing as openHAB process of making one single package.

This means that openhab2-online and openhab2-offline will become simply openhab2. For those looking for the offline installation, an additional addons pack can be used. This is still being tested but you can be sure that there will be more details in an announcement soon.

Ah, ok! Thanks for the info!

FTR, I will do another announcement on this later tonight that explains those changes.

2 Likes

Hi,

just performed the following steps and everything works fine with the “new” repos.
Great job, guys!

sudo service openhab2 stop
sudo tar cvfz OH2_config_save_11_01_2017.tgz /etc/openhab2/ /var/lib/openhab2/ /usr/share/openhab2/addons/
sudo apt-get --force-yes remove openhab2-offline
sudo apt-get install openhab2
cd / && tar xvfz OH2_config_save_11_01_2017.tgz

Edited again /usr/share/openhab2/runtime/bin/setenv to add
-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0

and then came the moment:
sudo service openhab2 start

awaiting another night of having to correct or restore configurations or returning to a saved image of the SD-card.

BUT: everything works perfect, all devices (things) and rules are up and running, the Android Pad in the corridor shows up the latest HabPanel modifications…

I love this progress!

Best regards,
Jens

2 Likes

Just out of curiosity: Is it anywhere documented to do it that way?
I ask, because this file should not been touched by users - instead the environment variable ${JAVA_OPTS} should be set.

1 Like

In fact it is documented but in a different way
http://docs.openhab.org/installation/linux.html#package-repository-installation

the following setting has to be added/adapted on your system in file /etc/default/openhab2:
EXTRA_JAVA_OPTS=“-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyAMA0”

and this simply works :wink:

2 Likes

yes, you’re both right. Put the option into /etc/default/openhab2 and changed back setenv to original state.
Yes, that simply works :slight_smile:

And it works better because /etc/default/openhab2 doesn’t get reset on upgrade :wink:

What about updating the beta release? Do I just use:
echo ‘deb http://dl.bintray.com/openhab/apt-repo2 testing main’ | sudo tee /etc/apt/sources.list.d/openhab2.list
sudo apt-get update
sudo apt-get upgrade

Absolutely! The “testing” part defines the beta branch of releases.

stable - Offical release (none just yet)
testing - beta releases
unstable - nightly builds (also untested, added automatically.)

The last addons repo update went wrong and seems to have bricked my Raspberry Pi.
See the attached log. Maybe you can get some info out of it to make the process more stable.
I think I’ll try the latest raspbian to get set up again (currently I was running a setup using apt-get.

pi@raspberrypi:~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  openhab2 openhab2-addons
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 187 MB of archives.
After this operation, 27.6 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://dl.bintray.com/openhab/apt-repo2/ unstable/main openhab2 all 2.0.0~20170115042227-1 [52.1 MB]
Get:2 http://dl.bintray.com/openhab/apt-repo2/ unstable/main openhab2-addons all 2.0.0~20170115042227-1 [135 MB]
Fetched 187 MB in 34s (5,401 kB/s)
Reading changelogs... Done
(Reading database ... 37244 files and directories currently installed.)
Preparing to unpack .../openhab2_2.0.0~20170115042227-1_all.deb ...
Unpacking openhab2 (2.0.0~20170115042227-1) over (2.0.0~20170112185728-1) ...
Preparing to unpack .../openhab2-addons_2.0.0~20170115042227-1_all.deb ...
Unpacking openhab2-addons (2.0.0~20170115042227-1) over (2.0.0~20170112185728-1) ...
dpkg: error processing archive /var/cache/apt/archives/openhab2-addons_2.0.0~20170115042227-1_all.deb (--unpack):
 error setting ownership of `./usr/share/openhab2/addons/openhab-addons-2.0.0-SNAPSHOT.kar': Read-only file system
dpkg: error while cleaning up:
 unable to remove newly-extracted version of `/usr/share/openhab2/addons/openhab-addons-2.0.0-SNAPSHOT.kar': Read-only file system
dpkg: error while cleaning up:
 unable to securely remove '/var/lib/dpkg/tmp.ci': Read-only file system
dpkg: error while cleaning up:
 unable to securely remove '/var/lib/dpkg/reassemble.deb': Read-only file system
Processing triggers for systemd (215-17+deb8u5) ...
dpkg: unrecoverable fatal error, aborting:
 unable to flush updated status of `systemd': Read-only file system
E: Sub-process /usr/bin/dpkg returned an error code (2)
E: Failed to write temporary StateFile /var/lib/apt/extended_states.tmp

That looks like an SD card failure to me. I’ll try and run some tests on upgrades.

Hi MikeH!
After executing this the echo part and the wget part I try to run: sudo apt-get install -t unstable openhab-online
E: Value “unstable” not allowed for APT::DEFAULT-RELEASE, value is not available.
What do I make wrong -how can I correct this.
I make a fresh installation on a raspberry PI with actual image.
Thanks for your help.
Georg