Replacement of the Apt Snapshot Repository

(Ben Clark) #21

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

(Dayve67) #22

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

(Ben Clark) #23

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.)

(Raimond Brookman) #24

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 unstable/main openhab2 all 2.0.0~20170115042227-1 [52.1 MB]
Get:2 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/': 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

(Ben Clark) #25

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

(Georg Jungermann) #26

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.

(Ben Clark) #27
wget -qO - '' | sudo apt-key add -
echo 'deb unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
sudo apt-get update
sudo apt-get install openhab2 

Will work fine. If you’re looking for the more stable beta branch, then it’s

wget -qO - '' | sudo apt-key add -
echo 'deb testing main' | sudo tee /etc/apt/sources.list.d/openhab2.list
sudo apt-get update
sudo apt-get install openhab2 

(Georg Jungermann) #28

Thanks Benjy
for four quick reply
it worked.
Kind regards

(Maciej Eckstein) #29

Hi, a quick question
I used openhasbian install. I was on the old snapshot build #65x. Today updated the repo to the unstable branch to get the latest build and that got me to the #693

But that’s a build from 4th Jan, Why not the latest?

sudo apt-get update 
sudo apt-get upgrade 

Is not taking me any further?

should I do ?
sudo apt-get install openhab2

Will it upgrade my curent setup and keep my config? I’m afraid to do a separate parallel install and not to mess my house.

(Angelos) #30

First of all, take a backup of your configs. You won’t lose anything during the upgrade but as they say: “better safe than sorry”

Then, follow these steps:

(Maciej Eckstein) #31

Thanks, I missed that post.
sudo apt-get install openhab2
got me to the latest version without the problems. Just lost server saved habpanel, as usual, but that stays in local browser and can be saved back to the server easily

(Andrew) #32

That’s weird but now I have the problem with the serial port after upgrading from snapshot to beta/RC.
I’ve created a separate thread on this issue.

(Erik Ahlström) #33

Hi guys,

Anyone had any issues upgrading today to the lastest oh2 apt-get unstable version?
I just did an apt-get update + upgrade and restarted my rpi3 and openhab2 doesn’t come online fully.

The OH2 service is active if I check “systemctl status openhab2.service” but karaf doesn’t respond and neither does any of the guis at 192.168.x.x:8080.

Any advice on where I should start my trouble shooting?
I’m rather new to running both linux and openhab2 and this is a new problem to me.

(Angelos) #34

Start by looking into the /var/log/openhab2/openhab.log file.

sudo su // switch to root
cd /var/log/openhab2 // change directory to the logging directory (optional)
systemctl stop openhab2.service // stop OH2
rm /var/log/openhab2/openhab.log // remove the existing log file
systemctl start openhab2.service // start OH2
tail -f /var/log/openhab2/openhab.log // monitor the log file for errors

Post here your findings :slight_smile:

(Erik Ahlström) #35

Nice thank you Angelos. I wasn’t aware that you could tail the log outside of karaf. :slight_smile:

Now tailling the log didn’t give me a whole lot of extra info I’m afraid.
This is my log after starting the openhab2 service and the tailing the log:

2017-01-29 17:50:48.396 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'main_door_open.rules'
2017-01-29 17:50:48.794 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'brand_juvelias.rules'
2017-01-29 17:50:48.819 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'back_door_open.rules'
2017-01-29 17:50:48.854 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'brand_sovrum.rules'
2017-01-29 17:50:48.875 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'brand_hallen.rules'

Nothing more comes.
I added new rules yesterday. So to be safe I removed all the rules. Then restarted the openhab2 service.
The openhab log i now entirely empty.
ssh openhab@localhost -p 8101 gives me "connection refused"
systemctl status openhab2.service says the service is running.

Maybe I should wait until the next release comes? Maybe something went wrong in the latest one?

(Angelos) #36

Does it give any other info (maybe a hint that something is wrong)?

root@homer:~# systemctl status openhab2.service 
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: active (running) since Sun 2017-01-29 14:43:54 EET; 4h 45min ago
  Process: 5190 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=1/FAILURE)
 Main PID: 5414 (karaf)
   CGroup: /system.slice/openhab2.service
           ├─5414 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           └─5587 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -...

Jan 29 14:43:54 homer systemd[1]: Started openHAB 2 - empowering the smart home.
Jan 29 14:43:54 homer[5414]: Launching the openHAB runtime...

check also the output of java -version command.

Another way to deal with this could be: Backup your /etc/openhab2/ and /var/lib/openhab2 folders and then apt-get remove openhab2 followed by apt-get install openhab2 (to re-install it without losing your configs). This would be the last resort.

I updated my OH2 Snapshot recently and I didn’t have any problems (from the deb unstable main repository)

(Erik Ahlström) #37

The status is similar to yours. No indications of anything wrong going on.

pi@Home:/var/log/openhab2 $ sudo systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: active (running) since Sun 2017-01-29 18:13:39 CET; 58min ago
 Main PID: 525 (karaf)
   CGroup: /system.slice/openhab2.service
           ├─ 525 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           └─1038 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab....

Jan 29 18:13:39 SkyNetHome systemd[1]: Started openHAB 2 - empowering the s...e.
Jan 29 18:13:40 SkyNetHome[525]: Launching the openHAB runtime...
Hint: Some lines were ellipsized, use -l to show in full.
pi@Home:/var/log/openhab2 $

I’ll give a re-install a try and see if that changes anything.
Cheers Angelos

(Erik Ahlström) #38

Did the full re-install and it’s now working again. So strange! Luckily all settings were intact! :smiley:

(Max1968) #39

I had the same yesterday, stopped openhab using systemctl, cleaned up cache and tmp directories, and started again using systemctl - this fixed it for me. Perhaps (@maintainers) it might make sense to clean cache/tmp during updates as well ?

(Erik Ahlström) #40

Nice, thanks for the advice Max. I’ll make a note of this until next time. :slight_smile: